File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
packages/wonder-blocks-card/src/__tests__/components Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,29 @@ 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 = { {
140+ dismissButtonAriaLabel : "Custom Close" ,
141+ } }
142+ >
143+ < div > Content</ div >
144+ </ Card > ,
145+ ) ;
146+
147+ // Act
148+ const dismissButton = screen . getByRole ( "button" , {
149+ name : "Custom Close" ,
150+ } ) ;
151+
152+ // Assert
153+ expect ( dismissButton ) . toBeInTheDocument ( ) ;
154+ } ) ;
155+
156+ it ( "should pass custom aria-describedby to dismiss button" , ( ) => {
135157 // Arrange
136158 render (
137159 < Card
@@ -152,7 +174,6 @@ describe("Card", () => {
152174 } ) ;
153175
154176 // Assert
155- expect ( dismissButton ) . toBeInTheDocument ( ) ;
156177 expect ( dismissButton ) . toHaveAttribute (
157178 "aria-describedby" ,
158179 "dismiss-button-describedby" ,
You can’t perform that action at this time.
0 commit comments