Skip to content

test(react-toast): add hook-level tests for toast components#36044

Merged
dmytrokirpa merged 2 commits into
microsoft:masterfrom
dmytrokirpa:test/react-toast-hook-regression-tests
May 18, 2026
Merged

test(react-toast): add hook-level tests for toast components#36044
dmytrokirpa merged 2 commits into
microsoft:masterfrom
dmytrokirpa:test/react-toast-hook-regression-tests

Conversation

@dmytrokirpa
Copy link
Copy Markdown
Contributor

@dmytrokirpa dmytrokirpa commented Apr 25, 2026

Summary

Adds hook-level tests for toast components.

Stacking Note

This PR is part of a stacked series and should be merged in order.

Merge order:

  1. test(react-toast): add hook-level tests for toast components #36044 tests (this PR)
  2. feat(react-toast): add base hooks/types and re-exports for headless composition #35914 base hooks/types and re-exports
  3. feat(react-toast): headless toast implementation #36059 headless toast implementation

@dmytrokirpa dmytrokirpa requested a review from a team as a code owner April 25, 2026 16:40
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 25, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds hook-level regression tests for useToast_unstable, useToastBody_unstable, and useToastTitle_unstable to lock down current behavior before the base-hook refactor in #35914 lands.

Changes:

  • New unit tests for useToast_unstable covering components/slots, backgroundAppearance derivation from appearance prop, intent from context, and prop spreading.
  • New unit tests for useToastBody_unstable covering slots, bodyId wiring, subtitle behavior, and backgroundAppearance from context.
  • New unit tests for useToastTitle_unstable covering slots, titleId wiring, intent handling, default media icon injection per intent, and user override behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/react-components/react-toast/library/src/components/Toast/useToast.test.ts Adds 8 hook tests for useToast_unstable.
packages/react-components/react-toast/library/src/components/ToastBody/useToastBody.test.ts Adds 10 hook tests for useToastBody_unstable.
packages/react-components/react-toast/library/src/components/ToastTitle/useToastTitle.test.tsx Adds 19 hook tests for useToastTitle_unstable, including default icon injection per intent.

@dmytrokirpa dmytrokirpa changed the title test(react-toast): add hook regression tests for useToast, useToastBody, useToastTitle test(react-toast): add hook-level tests for toast components May 14, 2026
Comment thread packages/react-components/react-toast/library/etc/react-toast.api.md Outdated
Comment thread change/@fluentui-react-toast-base-hooks.json Outdated
@dmytrokirpa dmytrokirpa force-pushed the test/react-toast-hook-regression-tests branch from 093d2dc to 24da237 Compare May 18, 2026 09:43
@dmytrokirpa dmytrokirpa merged commit a5dfa06 into microsoft:master May 18, 2026
12 checks passed
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.

3 participants