Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Make tests more resilient for React 18 upgrade #12861

Merged
merged 6 commits into from
Aug 6, 2024
Merged

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Aug 5, 2024

Split out from #10314

Prepares for some timing changes in React 18 & some other changes in RTL update required for R18 support

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Aug 5, 2024
@t3chguy t3chguy self-assigned this Aug 5, 2024
t3chguy added 2 commits August 5, 2024 11:22
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Copy link
Member

@dbkr dbkr left a 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/structures/UserMenu-test.tsx Outdated Show resolved Hide resolved
test/components/views/dialogs/UserSettingsDialog-test.tsx Outdated Show resolved Hide resolved
// simulate error initialising map in maplibregl
// @ts-ignore
mockMap.emit("error", { status: 404 });
sleep(10).then(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the sleep?

Copy link
Member Author

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 <7t3chguy@gmail.com>
Copy link
Member

@dbkr dbkr left a 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

t3chguy added 2 commits August 6, 2024 18:00
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy enabled auto-merge August 6, 2024 17:06
@t3chguy t3chguy added this pull request to the merge queue Aug 6, 2024
Merged via the queue into develop with commit 8285283 Aug 6, 2024
29 checks passed
@t3chguy t3chguy deleted the t3chguy/react18/tests branch August 6, 2024 17:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants