-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jobs/frontend: Francois Cabrol #622
Open
francoiscabrol
wants to merge
20
commits into
MewsSystems:master
Choose a base branch
from
francoiscabrol:jobs/frontend-francoiscabrol
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Jobs/frontend: Francois Cabrol #622
francoiscabrol
wants to merge
20
commits into
MewsSystems:master
from
francoiscabrol:jobs/frontend-francoiscabrol
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
François Cabrol Front-end test
The UI
I tried to keep it simple with only the 2 required views:
The implementation
I used react-query with hooks to get a cleaner architecture and a code easier to test.
There are the 2 custom hooks I used for the requests in the
hooks/movies.ts
fileThen the folder structure is simple:
The tests
I tried to figure out a way to test the application at minimum cost:
Future work
For the tests
Depending on your guideline, we could consider writing unit tests for the components. The SearchBar is the most interesting to test.
We could implement unit tests for the pages. I think it is unnecessary at this stage because Cypress already covers the main use cases. They won't take long to run since there are just a few features.
We could add tests for other error codes in the hooks tests.
We could run the tests in CI (github actions?) and in that case the cypress tests could be run against the production build using
npm run preview
For the features
We could replace the "load more" button by an infinite scroll
For the performances
We could probably reduce the number of component re-rendering. I finally didn't spend too much time on it since I had no performance issues. But if the project would have to grow it is something to keep in mind.
For the logs
In production it could be beneficial to get the front-end logs or at least the front-end errors in a tool like Sentry or Datadog. Very useful for debugging!
Voilà! I hope I met your requirement. I am waiting for your feedback!
François