Refactor ui tests to use @testing-library - #5355
Conversation
|
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
b44167d to
6ee7924
Compare
|
☔ The latest upstream changes (presumably #5360) made this pull request unmergeable. Please resolve the merge conflicts. |
820e5d8 to
c0c585c
Compare
| "**/sha3": "^2.0.7", | ||
| "**/solc": "^0.6.4", | ||
| "**/source-map-support": "0.5.16", | ||
| "**/yargs-parser": "^15.0.1", |
There was a problem hiding this comment.
No longer needed as all sub dependencies now resolve to versions which include the vulnerability patch
This commit replaces enzyme with @test-library, providing a much easier to use testing API
1901656 to
7edf5b2
Compare
| // const jobSpec2 = | ||
| // 'observationSource = """ ds [type=ds]; ds_parse [type=ds_parse]; ds_multiply [type=ds_multiply]; """' |
There was a problem hiding this comment.
Shouldn't have commented out code
There was a problem hiding this comment.
This has been uncommented now because it is used in the fixed test
| // This tests the update of the textbox but it doesn't currently work | ||
| // userEvent.paste(getByRole('textbox', { name: /TOML blob/i }), jobSpec2) | ||
|
|
||
| // expect( | ||
| // await findByText('ds_multiple', {}, { timeout: 1000 }), | ||
| // ).toBeInTheDocument() | ||
| // expect(await findByText('ds_parse')).toBeInTheDocument() | ||
| // expect(await findByText('ds')).toBeInTheDocument() |
There was a problem hiding this comment.
Shouldn't have commented out code. Also, why doesn't it work? 🙂
There was a problem hiding this comment.
Ah I spent too long on this one and was meant to circle back to it but I totally blanked on it. I've fixed it now
| }) | ||
| .finally(() => { | ||
| setLoading(false) | ||
| setValid(false) |
There was a problem hiding this comment.
Why this change? It seems like only doing setLoading(false) on error would not disable loading state on success?
There was a problem hiding this comment.
This was part of my debugging of tests that I was meant to come back to. Thanks for picking that up
Replaces
enzymewith@testing-library/reactto provide an easier to use testing library.With this library we are now testing what the user interacts with in the UI.
This commit does not change any implementation logic and is purely focused on refactoring the tests.