File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
packages/wonder-blocks-card/src/__tests__/components Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,27 @@ describe("Card", () => {
131131 } ) ;
132132
133133 describe ( "Accessibility" , ( ) => {
134- it ( "should pass custom aria attributes to dismiss button" , ( ) => {
134+ it ( "should pass custom aria-label to dismiss button" , ( ) => {
135+ // Arrange
136+ render (
137+ < Card
138+ onDismiss = { ( ) => { } }
139+ labels = { { dismissButtonAriaLabel : "Custom Close" } }
140+ >
141+ < div > Content</ div >
142+ </ Card > ,
143+ ) ;
144+
145+ // Act
146+ const dismissButton = screen . getByRole ( "button" , {
147+ name : "Custom Close" ,
148+ } ) ;
149+
150+ // Assert
151+ expect ( dismissButton ) . toBeInTheDocument ( ) ;
152+ } ) ;
153+
154+ it ( "should pass custom aria-describedby to dismiss button" , ( ) => {
135155 // Arrange
136156 render (
137157 < Card
@@ -152,7 +172,6 @@ describe("Card", () => {
152172 } ) ;
153173
154174 // Assert
155- expect ( dismissButton ) . toBeInTheDocument ( ) ;
156175 expect ( dismissButton ) . toHaveAttribute (
157176 "aria-describedby" ,
158177 "dismiss-button-describedby" ,
You can’t perform that action at this time.
0 commit comments