Skip to content
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

Feat/ph0000/senior software engineer #1

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

javierlopezdeancos
Copy link
Owner

@javierlopezdeancos javierlopezdeancos commented Jan 29, 2023

Senior Software Engineer to Aircall Frontend Hiring Test

  • Add unit tests for the date helper functions.
  • Fix the logout feature. For now, it does redirect the users to the login page, but they are automatically redirected back to the calls list.
  • Fix the token expiration UX. Access tokens are invalid after 10 minutes, making all new requests fail. Either improve the user experience by redirecting users to the login page with an information toast or use the refresh token (see API docs).
  • Add an end to test for the feature of your choice. For instance, test that users can log into the app, access to the details of call and log out.
  • Implement the archive call feature and add real-time support. Meaning that if you open the app in 2 tabs, archive a call from the first tab, the second tab must reflect this change. Create a PR for this feature as if you were submitting it to our team, for it to be merged and released in production. As we try to work asynchronously, writing skills are important to us.

Add unit tests for the date helper functions.

Add some functions using jest to some date helpers use cases and some corner cases.

Fix the logout feature

Logout, delete all local storage information about tokens and return to login page. If user try to set directly in the URL search bar the calls URL again without having logged, then should be redirected to log in.

  • Create the hook useAuth that provide login, logout and isAuth methods to manage the state of the user and the user information in our app that we can use in each component. This hook is responsible to get the user info with the me gql query in order to have this information persists when the user refreshes the browser but is already logged in.

Fix the token expiration UX.

  • Now Apollo client check the availability of the token storage and refresh it if is needed to connect with our websocket or call by http to the gql api.
  • Create auth service to build the Apollo client to handle all that logic.
    Take into account that we Are Not supported graphql-ws protocol on server then we use subscriptions-transport-ws to build our subscriptions to our websockets with Apollo.

Add an end to end test for the feature of your choice

  • Installed playwright to run e2e test
  • Add some new scripts in package.jon with execution about e2e tasks.
  • Created an e2e test that check that user is able to log in, comes to calls list, click in anyone, see their details and logout.

Implement the archive call feature and add real-time support.

  • Organize better the page folder splitting by domain Login, Calls and bounded context.
  • Extract some parts of CallsList component into split components with single responsibility that allow better maintenance and readability.
  • Create onUpdatedCall gql subscription.
  • Subscribe CallsList and CallDetails to onUpdatedCall event from websocket in order to hear server updates about some call update.

Screenshots

aircall

@javierlopezdeancos javierlopezdeancos self-assigned this Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant