-
Notifications
You must be signed in to change notification settings - Fork 85
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
convert menu tests to RTL FE-6550 #6744
Conversation
d1371e0
to
3c634e6
Compare
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.
Nice work on this @edleeks87! 👏🏼 Managing the separation of tests for each subcomponent while rewriting them simultaneously must have been quite the task 😅 The test titles now carry a lot more context too 👍🏼
src/components/menu/menu-segment-title/menu-segment-title.test.tsx
Outdated
Show resolved
Hide resolved
src/components/menu/menu-segment-title/menu-segment-title.test.tsx
Outdated
Show resolved
Hide resolved
|
||
afterAll(() => loggerSpy.mockRestore()); | ||
|
||
test("should not match any item and return undefined when user enters no search string (empty string is passed in)", () => { |
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.
praise: these titles provide much more context behind how this util is used 👍
}); | ||
}); | ||
|
||
test("should not render when closed", () => { |
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.
suggestion(non-blocking): be more descriptive with test title
test("should not render when closed", () => { | |
test("menu should not render when submenu is closed", () => { |
expect(screen.queryByRole("menu")).not.toBeInTheDocument(); | ||
}); | ||
|
||
test("should render when mouseover event detected on parent menu item", async () => { |
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.
suggestion(non-blocking): could prepend all of these tests with submenu
to be more descriptive
test("should render when mouseover event detected on parent menu item", async () => { | |
test("submenu should render when mouseover event detected on parent menu item", async () => { |
Or this is when a describe block is quite handy too encapsulate likeminded tests. Very minor nitpick overall though, can just ignore if you want
3c634e6
to
b758236
Compare
src/components/menu/menu-segment-title/menu-segment-title.test.tsx
Outdated
Show resolved
Hide resolved
b758236
to
6913355
Compare
6913355
to
fc91a66
Compare
fc91a66
to
a09708b
Compare
🎉 This PR is included in version 138.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
Converts all unit test files to RTL
flattens test structure
removes unnecessary describe blocks
Current behaviour
Most unit tests are enzyme
Checklist
QA
Additional context
Testing instructions