Skip to content

Fixes #39482 - Replace enzyme test in UserDropdown with RTL - #11063

Merged
Lukshio merged 1 commit into
theforeman:developfrom
kfamilonidis:pf5-layout-toolbar
Sep 1, 2026
Merged

Fixes #39482 - Replace enzyme test in UserDropdown with RTL#11063
Lukshio merged 1 commit into
theforeman:developfrom
kfamilonidis:pf5-layout-toolbar

Conversation

@kfamilonidis

@kfamilonidis kfamilonidis commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #39482 - Replace enzyme test in HeaderToolbar, UserDropdown with…

@Lukshio

Lukshio commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Reasonable migration; the new "hides impersonate icon when not impersonated" test in HeaderToolbar.test.js is a good addition, and UserDropdowns.test.js is a clean, focused migration. However, mocking out nearly every child of HeaderToolbar drops some prop-wiring coverage the old snapshot had.

Critical (must fix before merge)

  • None

Suggestions (should fix)

  • The removed snapshot verified that TaxonomySwitcher received the correct locations/organizations arrays. The new mock (() => <div data-testid="taxonomy-switcher" />) ignores props entirely, so that data-flow coverage is lost. Consider surfacing the received props in the mock (similar to how the UserDropdowns/ImpersonateIcon mocks already render user.current_user.name / stopImpersonationUrl) so this regression class is still caught.
  • Commit message uses Fixes #39482: ... - 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

Checklist gaps

  • TaxonomySwitcher prop-wiring coverage lost in the migration (see above).
  • Commit message hyphen convention.

@kfamilonidis

Copy link
Copy Markdown
Contributor Author

@Lukshio The TaxonomySwitcher mock now surfaces its received props.

@kfamilonidis kfamilonidis changed the title Fixes #39482: Replace enzyme test in HeaderToolbar, UserDropdown with… Fixes #39482 - Replace enzyme test in HeaderToolbar, UserDropdown with… Jul 15, 2026
@andreilakatos

Copy link
Copy Markdown
Contributor

@Lukshio @kfamilonidis
Should be rebased, I created this PR for HeaderToolbar that was merged
#11198

Will link this PR to the UserDropdown ticket

@Lukshio Lukshio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, passes locally, Thanks @kfamilonidis @andreilakatos

@Lukshio Lukshio changed the title Fixes #39482 - Replace enzyme test in HeaderToolbar, UserDropdown with… Fixes #39482 - Replace enzyme test in UserDropdown with RTL Sep 1, 2026
@Lukshio
Lukshio merged commit f3e5e05 into theforeman:develop Sep 1, 2026
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants