Skip to content

Fixes #39492 - Replace enzyme test in SettingsTable, SettingsCell, SettingsName with RTL - #11084

Open
kfamilonidis wants to merge 1 commit into
theforeman:developfrom
kfamilonidis:pf5-setttings-table
Open

Fixes #39492 - Replace enzyme test in SettingsTable, SettingsCell, SettingsName with RTL#11084
kfamilonidis wants to merge 1 commit into
theforeman:developfrom
kfamilonidis:pf5-setttings-table

Conversation

@kfamilonidis

Copy link
Copy Markdown
Contributor

Fixes #39492: Replace enzyme test in SettingsTable, SettingsCell, SettingsName with RTL

@Lukshio

Lukshio commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@kfamilonidis please add more testing cases

@Lukshio Lukshio self-assigned this Jul 8, 2026
@kfamilonidis
kfamilonidis force-pushed the pf5-setttings-table branch from 8f88452 to c75b1ae Compare July 8, 2026 11:15
@kfamilonidis

Copy link
Copy Markdown
Contributor Author

Added 4 more tests that check the settings table values (instead of row headers that was before)

@kfamilonidis
kfamilonidis force-pushed the pf5-setttings-table branch 3 times, most recently from 5ff80b6 to aabfb44 Compare July 8, 2026 13:42
@Lukshio

Lukshio commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Good migration across SettingsTable, SettingCell, and SettingName. The author already responded to the earlier "please add more testing cases" feedback by adding 4 behavior-driven tests (cell text, cancel-exits-edit, Escape-exits-edit, select-submit). Solid overall.

Critical (must fix before merge)

  • None

Suggestions (should fix)

  • SettingsTable.test.js still builds its store with configureMockStore/mockStore (redux-mock-store). The project's testing guidelines call this out as deprecated for new tests in favor of a real store with initial-state fixtures. Since this PR already reworks the surrounding tests, consider swapping it out here (or note it as a deliberate, scoped-out follow-up).
  • Several assertions use raw document.querySelector('button#administrator') / [data-ouia-component-id=...] instead of RTL's screen.getByRole/getByLabelText. This matches the pre-existing style in the file, so not a regression, but worth moving to accessible queries where a role/label exists, for resilience if ids ever change.
  • Commit message uses Fixes #39492: ... - the documented convention (see develop history, e.g. Fixes #38653 - Fix settings show endpoint) is Fixes #XXXXX - description with a hyphen, not a colon.

Nice to have (optional)

  • None beyond the above.

Checklist gaps

  • redux-mock-store usage not addressed (see above).
  • Commit message hyphen convention.

@kfamilonidis

Copy link
Copy Markdown
Contributor Author

@Lukshio Replaced mock store with a real redux store.
I changed in the three interaction tests with role based assertions.
Left on data-ouia-* deliberately, with a comment noting why.

@kfamilonidis
kfamilonidis force-pushed the pf5-setttings-table branch from a38df2e to a0b5b6f Compare July 14, 2026 14:09
@kfamilonidis kfamilonidis changed the title Fixes #39492: Replace enzyme test in SettingsTable, SettingsCell, SettingsName with RTL Fixes #39492 - Replace enzyme test in SettingsTable, SettingsCell, SettingsName with RTL Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants