Fixes #39439 - replace AuditsPage tests with RTL testing#11032
Conversation
e5b2e10 to
679a598
Compare
Review: Fixes #39439 - replace AuditsPage tests with RTL testingGood direction — snapshot tests were brittle and the 311-line snap file was pure noise. A few things to address: Use
|
|
Done @ofedoren |
Re-review after updateAll four points from the previous review are addressed —
|
f14d6da to
d70e773
Compare
|
lgtm from my side, any objections @ofedoren ? |
MariaAga
left a comment
There was a problem hiding this comment.
Tests look good to me, @andreilakatos Can you squash please?
d70e773 to
6cf5676
Compare
6cf5676 to
242edad
Compare
|
Thanks @andreilakatos |
Fixes #39439
Summary
Replaces brittle snapshot-based tests for
AuditsPagewith React Testing Library (RTL) behavioral tests, and fixes the sharedrenderWithStoreAndI18n/renderWithI18nhelpers so they can be used as the standard test setup going forward.Changes
AuditsPage tests (
AuditsPage.test.js)AuditsPage.test.js.snapfile.rtlHelpers.renderWithStoreAndI18n()for Redux + i18n wrapping.renderAuditsPage()viaawait intl.ready, so individual tests can use synchronous RTL queries afterward.Fixtures (
AuditsPage.fixtures.js)auditsanditemCounttoauditsPageProps, since they are required byAuditsTableand should not need to be repeated in every test.RTL test helpers (
rtlTestHelpers.js)Fixes
renderWithI18n()andrenderWithStoreAndI18n(), which previously treatedi18nProviderWrapperFactory()as a React component: