-
-
Notifications
You must be signed in to change notification settings - Fork 814
Make tests more resilient for React 18 upgrade #12861
Conversation
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
dbkr
left a comment
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.
In general this is a lot of manual waitFors but it feels like these should be using the find queries that have the waiting built in?
test/components/views/dialogs/AccessSecretStorageDialog-test.tsx
Outdated
Show resolved
Hide resolved
| // simulate error initialising map in maplibregl | ||
| // @ts-ignore | ||
| mockMap.emit("error", { status: 404 }); | ||
| sleep(10).then(() => { |
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.
why the sleep?
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.
Timings change in React 18 and otherwise this error was emitted too early and missed by the component being rendered
Signed-off-by: Michael Telatynski <[email protected]>
dbkr
left a comment
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.
OK - there are lots more waitFors that look like they could be findBys, but I don't know the context
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Split out from #10314
Prepares for some timing changes in React 18 & some other changes in RTL update required for R18 support