-
Notifications
You must be signed in to change notification settings - Fork 116
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
chore(tests): Migrate from Enzyme to RTL (1st batch) #1535
Conversation
src/lib/viewers/box3d/image360/__tests__/Image360Controls-test.tsx
Outdated
Show resolved
Hide resolved
src/lib/viewers/box3d/image360/__tests__/Image360Controls-test.tsx
Outdated
Show resolved
Hide resolved
src/lib/viewers/box3d/image360/__tests__/Image360Controls-test.tsx
Outdated
Show resolved
Hide resolved
src/lib/viewers/box3d/model3d/__tests__/Model3DControlsNew-test.tsx
Outdated
Show resolved
Hide resolved
src/lib/viewers/controls/settings/__tests__/SettingsList-test.tsx
Outdated
Show resolved
Hide resolved
src/lib/viewers/controls/settings/__tests__/SettingsDropdown-test.tsx
Outdated
Show resolved
Hide resolved
This is a massive PR - tremendous work but hard to review. I know it is difficult to push each PR separately, but is way easier to meaningfully review so maybe split more next time :)? Another thought - or rather question. I do know that EUA uses special tooling based on RTL. Don't remember details, but it integrates Redux somehow. Do you know why it was needed there and if it might be here? |
+1 for me. Splitting the PR by feature or folder would make a significant difference. It would not only make it easier to review but also easier for you to work on the changes (in terms of time and capacity) and quicker to merge bit by bit instead of blocking the merge for the entire PR due to comments on a single file. |
expect(screen.getByLabelText('Breadcrumb')).toBeInTheDocument(); | ||
expect(screen.getAllByRole('button')).toHaveLength(3); | ||
expect(screen.getAllByRole('button').at(0).textContent).toContain('test.zip'); | ||
expect(screen.getAllByRole('button').at(1).textContent).toContain('test'); |
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.
Nit: you could do screen.getAllByRole('button')
only once:
expect(screen.getAllByRole('button').at(1).textContent).toContain('test'); | |
const buttons = screen.getAllByRole('button') | |
expect(buttons.at(1).textContent).toContain('test'); |
Description
Tests with Enzyme migrated: 23/61
This PR is a part of Box-wide migration to the newer React v18.
fireEvent
executed on top of specific selectors instead of recommendeduserEvent
. Some of these tradeoffs could be avoided (possibly) but would extend the timelines of this PR. I suggest improve these test iteratively as we work on them.data-testid
attributes were added mostly for container elements to quickly validate if container is rendered.data-testid
changes mentioned above)This PR will be followed with the next steps:
Screenshots