@@ -2,7 +2,7 @@ import React from "react";
22import { describe , expect , it } from "vitest" ;
33import { render , screen } from "@testing-library/react" ;
44import { Plus } from "@phosphor-icons/react" ;
5- import { Button , RefreshButton , LinkButton } from "./button" ;
5+ import { Button , RefreshButton , LinkButton , buttonVariants } from "./button" ;
66
77describe ( "Button" , ( ) => {
88 describe ( "children wrapper" , ( ) => {
@@ -112,6 +112,21 @@ describe("Button", () => {
112112 // title is intercepted by Tooltip wrapper, not set as native attribute
113113 expect ( button . getAttribute ( "title" ) ) . toBeNull ( ) ;
114114 } ) ;
115+
116+ it ( "keeps emphasized variant rings color-matched when pressed or focused" , ( ) => {
117+ for ( const variant of [ "primary" , "destructive" ] as const ) {
118+ const className = buttonVariants ( { variant } ) ;
119+
120+ expect ( className ) . toContain ( "ring-(--kumo-button-emphasis-ring)" ) ;
121+ expect ( className ) . toContain ( "focus:ring-(--kumo-button-emphasis-ring)" ) ;
122+ expect ( className ) . toContain (
123+ "focus-visible:ring-(--kumo-button-emphasis-ring)" ,
124+ ) ;
125+ expect ( className ) . toContain ( "active:ring-(--kumo-button-emphasis-ring)" ) ;
126+ expect ( className ) . not . toContain ( "focus:ring-kumo-focus/50" ) ;
127+ expect ( className ) . not . toContain ( "focus-visible:ring-kumo-brand" ) ;
128+ }
129+ } ) ;
115130} ) ;
116131
117132describe ( "RefreshButton" , ( ) => {
0 commit comments