You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What: Write unit tests for some of the React components to ensure they work as expected.
Why: Tests are crucial for maintaining code quality and preventing regressions. They allow us to make changes to the codebase with more confidence.
How:
The project uses @testing-library/react for testing. You can look at App.test.js for a basic example.
Pick a component, for example, SideBar.js or ChatModal.js.
Write a test file (e.g., SideBar.test.js) in the same directory as the component.
Write tests to check if the component renders correctly, if it responds to user interactions (like clicks), and if it displays the correct information based on its props.
You can run the tests using the pnpm test command.
What: Write unit tests for some of the React components to ensure they work as expected.
Why: Tests are crucial for maintaining code quality and preventing regressions. They allow us to make changes to the codebase with more confidence.
How:
@testing-library/reactfor testing. You can look atApp.test.jsfor a basic example.SideBar.jsorChatModal.js.SideBar.test.js) in the same directory as the component.pnpm testcommand.