-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cody/add tests for NavDrawer #652
base: develop
Are you sure you want to change the base?
Conversation
Gridiron Survivor Application
Project name: Gridiron Survivor Application
Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, I'm expecting a unit test for each functional component. Even though Drawer brings them all in, each functional component should have its own isolated unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this component is called NavDrawer, why do have have all these drawer components inside of it? The only thing NavDrawer is the name.
<DrawerClose> | ||
<X /> | ||
<DrawerClose data-testid="drawer-close"> | ||
<X data-testid="drawer-close-icon" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BEM naming convention please.
<X data-testid="drawer-close-icon" /> | |
<X data-testid="drawer-close__icon" /> |
|
||
describe('DrawerHeader Component', () => { | ||
it('renders with default classes', () => { | ||
render(<DrawerHeader data-testid="drawer-header" />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be manually setting data-testid's via test. These attributes should be part of the component.
render(<DrawerHeader data-testid="drawer-header" />); | ||
|
||
const header = screen.getByTestId('drawer-header'); | ||
expect(header).toHaveClass( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to test the styles. E2E testing will cover this. Whenever we get it. Instead, test the default state and the props coming in to the component. Ensure they work as intended and change and intended.
Closes #223