Page MenuHomePhabricator

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

Authored by bytesofman on Feb 26 2024, 13:25.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable