Skip to content

test(react-tags): add hook regression tests for Tag family#36229

Open
mainframev wants to merge 3 commits into
feat/headless-tag-1-refactorfrom
feat/headless-tag-2-regression-tests
Open

test(react-tags): add hook regression tests for Tag family#36229
mainframev wants to merge 3 commits into
feat/headless-tag-1-refactorfrom
feat/headless-tag-2-regression-tests

Conversation

@mainframev
Copy link
Copy Markdown
Contributor

@mainframev mainframev commented May 19, 2026

Stack

This PR is part of a 3-PR stack. Review and merge bottom-up:

  1. feat(react-tags): decouple useTagGroupBase_unstable from Tabster + export contexts #36228 — feat(react-tags): decouple useTagGroupBase_unstable from Tabster + export contexts (base: master) — merge first
  2. 👉 test(react-tags): add hook regression tests for Tag family #36229 — test(react-tags): add hook regression tests for Tag family (base: feat(react-tags): decouple useTagGroupBase_unstable from Tabster + export contexts #36228)depends on feat(react-tags): decouple useTagGroupBase_unstable from Tabster + export contexts #36228
  3. feat(react-headless-components-preview): add Tag family #36230 — feat(react-headless-components-preview): add Tag family (base: test(react-tags): add hook regression tests for Tag family #36229) — merge last; depends on test(react-tags): add hook regression tests for Tag family #36229

Summary

Adds renderHook-based regression tests for the Tag, InteractionTag, InteractionTagPrimary, InteractionTagSecondary, and TagGroup base + styled hooks. Locks in the public output shape so subsequent base-hook refactors (such as the Tabster decoupling in #36228) cannot silently regress the styled hooks.

Coverage highlights:

  • Slot element type via root.type (button vs span), event-handler presence/absence
  • Default DismissRegular injection happens only in the styled hooks (useTag_unstable, useInteractionTagSecondary_unstable), never in the base hooks
  • Context inheritance for appearance / size from TagGroupContext
  • Context override for disabled (group overrides tag prop)
  • New UseTagGroupBaseOptions contract: arrowNavigationProps is spread onto root, onAfterTagDismiss is invoked after a dismiss; both default to no-op
  • ARIA: aria-selected (listbox), aria-pressed (default), aria-labelledby (InteractionTagSecondary)

Stack created with GitHub Stacks CLIGive Feedback 💬

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@mainframev mainframev force-pushed the feat/headless-tag-1-refactor branch from 99f8a77 to 24a9f85 Compare May 19, 2026 22:24
@mainframev mainframev force-pushed the feat/headless-tag-2-regression-tests branch from 36292c8 to f368d08 Compare May 19, 2026 22:24
@mainframev mainframev marked this pull request as ready for review May 20, 2026 01:11
@mainframev mainframev requested review from a team and ValentinaKozlova as code owners May 20, 2026 01:11
@mainframev mainframev force-pushed the feat/headless-tag-2-regression-tests branch from 77859e1 to 495dfb9 Compare May 20, 2026 01:36
@mainframev mainframev force-pushed the feat/headless-tag-2-regression-tests branch from 495dfb9 to 1d660cc Compare May 20, 2026 01:53
@mainframev mainframev force-pushed the feat/headless-tag-1-refactor branch from 24a9f85 to 4af8734 Compare May 20, 2026 02:04
@mainframev mainframev force-pushed the feat/headless-tag-2-regression-tests branch from 1d660cc to 14b9a10 Compare May 20, 2026 02:04
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.

1 participant