Fixes #39473 - Replace enzyme test in HostStatuses/Status with RTL - #11058
Fixes #39473 - Replace enzyme test in HostStatuses/Status with RTL#11058kfamilonidis wants to merge 1 commit into
Conversation
8c24272 to
6c5587a
Compare
SummaryGood migration from a brittle full-render snapshot to explicit RTL assertions on rendered text and link hrefs — this is a real improvement in signal over the old snapshot (which would break on any unrelated markup/prop change). Suggestions (should fix)
Nice to have (optional)
Checklist gaps
|
|
@Lukshio I added toHaveAttribute('href', …) assertions for all three Owned: links. |
|
|
||
| describe('Status', () => { | ||
| testComponentSnapshotsWithFixtures(Status, fixtures); | ||
| it('renders Status', () => { |
There was a problem hiding this comment.
Same as the other PR, a split into multiple it statements would be clearer
| import { store } from '../HostStatuses.fixtures.js' | ||
| import { testComponentSnapshotsWithFixtures } from '../../../common/testHelpers'; | ||
|
|
||
| jest.mock('react-redux', () => ({ |
There was a problem hiding this comment.
Also, I know you didn't make this change, but the test contains some mocking issue:
This needs to be:
selectHostStatusOwnedPaths: jest.fn().mockReturnValue({
okOwnedPath: get(status, 'ok_owned_path'),
warnOwnedPath: get(status, 'warn_owned_path'),
errorOwnedPath: get(status, 'error_owned_path'),
}),
And then you need to fix the tests in the function
07be93d to
d3b378c
Compare
|
@Lukshio Still using getByText, but other than that this should be good to go |
|
@Lukshio @kfamilonidis |
Fixes #39473: Replace enzyme test in HostStatuses/Status with RTL