Skip to content

test(react-button): add SplitButton regression test before base-hook extraction - #36523

Open
mainframev wants to merge 1 commit into
masterfrom
test/split-button-hook-regression-tests
Open

test(react-button): add SplitButton regression test before base-hook extraction#36523
mainframev wants to merge 1 commit into
masterfrom
test/split-button-hook-regression-tests

Conversation

@mainframev

@mainframev mainframev commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Pure regression-test safety net for the existing, unmodified SplitButton/useSplitButton_unstable in @fluentui/react-button, added before any refactor. This is PR 1 of a 3-PR stack that extracts a design-agnostic useSplitButtonBase_unstable base hook and builds a headless SplitButton primitive on top of it.

Stack:

  1. this PR — regression tests only, against the unmodified hook
  2. feat/split-button-base-hook@fluentui/react-button base-hook extraction (base: this branch)
  3. feat/split-button-headless — headless SplitButton in @fluentui/react-headless-components-preview (base: PR 2's branch)

What changed

  • Added tests to SplitButton.test.tsx covering:
    • ref forwarding to the root DIV element
    • default styled menu chevron rendering
    • explicit menu icon override
    • resolved child slot metadata (SLOT_ELEMENT_TYPE_SYMBOL) pointing at the styled Button/MenuButton

These tests were verified to pass against master's current, unmodified useSplitButton_unstable before any refactor was made — they are a pure safety net, not coupled to the upcoming refactor.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@mainframev mainframev changed the title test(react-button): add SplitButton regression coverage before base-hook extraction test(react-button): add SplitButton regression test before base-hook extraction Aug 5, 2026
@mainframev
mainframev force-pushed the test/split-button-hook-regression-tests branch from 52c3b76 to faba25f Compare August 5, 2026 20:11
…ook extraction

Adds coverage for behavior that must not regress when useSplitButton_unstable
is later split into a design-agnostic base hook plus a styled wrapper:
- ref forwarding resolves to the root DIV element
- the default styled MenuButton chevron still renders when no menuIcon is given
- an explicit menuIcon still overrides the default chevron
- resolved child slot element metadata points at the styled Button/MenuButton
  components (not just state.components)

All added tests pass against the current (unmodified) useSplitButton_unstable
implementation, confirming this is a pure safety net with no behavior change.
@mainframev
mainframev force-pushed the test/split-button-hook-regression-tests branch from faba25f to ef09037 Compare August 5, 2026 20:18
@@ -0,0 +1,7 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Positioning 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 959 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 44 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 25 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 175 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled.chromium.png 677 Changed
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

@mainframev
mainframev marked this pull request as ready for review August 5, 2026 21:54
@mainframev mainframev self-assigned this Aug 5, 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.

1 participant