@@ -20,6 +20,14 @@ const noticeStylesheet = readFileSync(
2020 `${ process . cwd ( ) } /src/components/ui/notice/index.module.css` ,
2121 "utf8"
2222) ;
23+ const toastStyles = readFileSync (
24+ `${ process . cwd ( ) } /src/components/ui/toast/index.module.css` ,
25+ "utf8"
26+ ) ;
27+ const confirmDialogStyles = readFileSync (
28+ `${ process . cwd ( ) } /src/components/ui/confirm-dialog/index.module.css` ,
29+ "utf8"
30+ ) ;
2331
2432function getLastGroupedRuleBlockFrom ( source : string , pattern : RegExp ) {
2533 const matches = Array . from ( source . matchAll ( pattern ) ) ;
@@ -103,6 +111,42 @@ describe("components.css theme-sensitive surfaces", () => {
103111 expect ( getLastRuleBlock ( ".mobile-dock__icon" ) ) . toContain ( "color: currentColor" ) ;
104112 } ) ;
105113
114+ it ( "keeps toast icons on icon semantic tokens instead of raw status colors" , ( ) => {
115+ expect ( getLastRuleBlock ( ".toast--success .toast__icon" ) ) . toContain ( "var(--icon-success)" ) ;
116+ expect ( getLastRuleBlock ( ".toast--error .toast__icon" ) ) . toContain ( "var(--icon-error)" ) ;
117+ expect ( getLastRuleBlock ( ".toast--warning .toast__icon" ) ) . toContain ( "var(--icon-warning)" ) ;
118+ expect ( getLastRuleBlock ( ".toast--info .toast__icon" ) ) . toContain ( "var(--icon-info)" ) ;
119+ expect ( getLastRuleBlockFrom ( toastStyles , ".success .icon" ) ) . toContain (
120+ "background: var(--icon-surface-success)"
121+ ) ;
122+ expect ( getLastRuleBlockFrom ( toastStyles , ".error .icon" ) ) . toContain (
123+ "background: var(--icon-surface-error)"
124+ ) ;
125+ expect ( getLastRuleBlockFrom ( toastStyles , ".warning .icon" ) ) . toContain (
126+ "background: var(--icon-surface-warning)"
127+ ) ;
128+ expect ( getLastRuleBlockFrom ( toastStyles , ".info .icon" ) ) . toContain (
129+ "background: var(--icon-surface-info)"
130+ ) ;
131+ expect ( getLastRuleBlockFrom ( toastStyles , ".success .icon" ) ) . toContain ( "var(--icon-success)" ) ;
132+ } ) ;
133+
134+ it ( "keeps confirm dialog danger icons on icon tokens" , ( ) => {
135+ expect ( getLastRuleBlockFrom ( confirmDialogStyles , ".titleDanger" ) ) . toContain (
136+ "var(--icon-warning)"
137+ ) ;
138+ expect ( getLastRuleBlockFrom ( confirmDialogStyles , ".iconDanger" ) ) . toContain (
139+ "color: var(--icon-warning)"
140+ ) ;
141+ } ) ;
142+
143+ it ( "keeps config status colors on icon tokens" , ( ) => {
144+ expect ( getLastRuleBlock ( ".config-status--success" ) ) . toContain ( "var(--icon-success)" ) ;
145+ expect ( getLastRuleBlock ( ".config-status--warning" ) ) . toContain ( "var(--icon-warning)" ) ;
146+ expect ( getLastRuleBlock ( ".config-status--info" ) ) . toContain ( "var(--icon-info)" ) ;
147+ expect ( getLastRuleBlock ( ".config-status--error" ) ) . toContain ( "var(--icon-error)" ) ;
148+ } ) ;
149+
106150 it ( "exposes global mobile safe-area tokens so standalone mobile views keep their padding" , ( ) => {
107151 expect ( tokensStylesheet ) . toContain ( "--mobile-safe-top: env(safe-area-inset-top, 0px);" ) ;
108152 expect ( tokensStylesheet ) . toContain ( "--mobile-safe-right: env(safe-area-inset-right, 0px);" ) ;
0 commit comments