test(react-toast): add hook regression tests for useToast, useToastBody, useToastTitle#36044
Open
dmytrokirpa wants to merge 5 commits intomicrosoft:masterfrom
Open
test(react-toast): add hook regression tests for useToast, useToastBody, useToastTitle#36044dmytrokirpa wants to merge 5 commits intomicrosoft:masterfrom
dmytrokirpa wants to merge 5 commits intomicrosoft:masterfrom
Conversation
…oastBody, useToastTitle Tests lock down the exact behaviors that PR microsoft#35914 refactors — backgroundAppearance mapping, context reads (intent, bodyId, titleId), and the media slot default-icon injection by intent — so any regression introduced by the base-hooks refactor will be caught immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
…sertions The `components` property is deprecated but these tests intentionally verify its shape as a regression guard while the API contract still exists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds unit tests that lock down the hook-level behaviors of
useToast_unstable,useToastBody_unstable, anduseToastTitle_unstablebefore #35914 lands.These tests act as a regression safety net: once #35914 refactors each hook to delegate to a
*Base_unstablevariant, CI must still pass all 37 of these cases — which verifies that the base-hook delegation produces identical output to the current implementation.useToast_unstable(8 tests)backgroundAppearancemaps directly fromprops.appearance(undefined/'inverted'/'brand')intentis read fromToastContainerContextcomponentsshape and root slot presencerootuseToastBody_unstable(10 tests)backgroundAppearancecomes fromBackgroundAppearanceContext(not from props)root.idis wired tobodyIdfromToastContainerContextsubtitleis absent when not provided, present when providedcomponentsshape and root slot presenceuseToastTitle_unstable(19 tests — highest regression risk)backgroundAppearancefromBackgroundAppearanceContextintentandtitleIdfromToastContainerContext;root.idappliedundefinedwithout intent; correct icon (CheckmarkCircleFilled/DiamondDismissFilled/WarningFilled/InfoFilled) per intentmedia.childrenoverride: explicit children must win over the default iconrenderByDefaultbehavior: media slot present whenever intent is set, even without a media prop