HomePhabricator

[Cashtab] Fix flaky tests by changing how we wait for elements expected to…

Description

[Cashtab] Fix flaky tests by changing how we wait for elements expected to render asynchronously

Summary:
Seeing some tests fail in CI (or locally, sometimes, only when all tests are run). Looking into it, seems to be a known issue with react testing library rendering elements that are expected asynchronously.

Make these tests more robust by using waitFor and by waiting for the component to be out of its expected initial loading state. Use more robust collapse selector and opener (this is where the failure would happen in App.test.js)

Test Plan: npm test

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D15550

Details

Provenance
bytesofmanAuthored on Feb 26 2024, 13:24
bytesofmanPushed on Feb 26 2024, 14:00
Reviewer
Restricted Project
Differential Revision
D15550: [Cashtab] Fix flaky tests by changing how we wait for elements expected to render asynchronously
Parents
rABCb0e0130e5ac9: [Cashtab] Delete all functions, files, and mocks related to legacy tx building
Branches
Unknown
Tags
Unknown