-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Enable throwSuggestions
RTL configuration
#3367
Conversation
@@ -1,4 +1,7 @@ | |||
import { act } from 'react-dom/test-utils'; | |||
import { configure } from '@testing-library/react'; | |||
|
|||
configure({ throwSuggestions: true }); |
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.
Duration 67.79s (transform 1.28s, setup 7.69s, collect 7.75s, tests 29.41s, environment 12.71s, prepare 2.69s)
The tests take over 1 minute now, I think it's fine to try it from time to time to improve tests, but I'm 👎 on keeping this enabled.
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.
How long does it take without this change?
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.
NVM I thought the GH CI was faster than that
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 can add it back
@@ -16,25 +16,25 @@ describe('Editor', () => { | |||
it('should open editor on double click', async () => { | |||
render(<EditorTest />); | |||
await userEvent.click(getCellsAtRowIndex(0)[0]); | |||
expect(screen.queryByLabelText('col1-editor')).not.toBeInTheDocument(); | |||
expect(screen.queryByRole('spinbutton', { name: 'col1-editor' })).not.toBeInTheDocument(); |
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.
What element are we actually querying here? I don't really understand what a spinbutton is
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.
input type=number
.
test/sorting.test.tsx
Outdated
); | ||
expect( | ||
JSON.parse(screen.getByTestId('sortColumnsValue', { suggest: false }).textContent!) | ||
).toStrictEqual(expectedValue); |
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.
Can we use toHaveTextContent
?
This reverts commit f051f4d.
* Enable `throwSuggestions` * Fix tests * Fix sorting tests * Update test/setup.ts * Revert "Update test/setup.ts" This reverts commit f051f4d. * Use `toHaveTextContent`
https://testing-library.com/docs/dom-testing-library/api-configuration/#throwsuggestions-experimental