File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,7 @@ describe('Alert component', () => {
13
13
test ( 'applies success styles when message contains "success"' , ( ) => {
14
14
render ( < Alert onClick = { ( ) => { } } message = "Success: Operation completed" /> ) ;
15
15
16
- const alertDiv = screen
17
- . getByText ( / s u c c e s s : o p e r a t i o n c o m p l e t e d / i)
18
- . getByRole ( 'alert' ) ;
16
+ const alertDiv = screen . getByRole ( 'alert' ) ;
19
17
20
18
expect ( alertDiv ) . toHaveClass (
21
19
'bg-teal-100' ,
@@ -26,9 +24,7 @@ describe('Alert component', () => {
26
24
test ( 'applies error styles when message does not contain "success"' , ( ) => {
27
25
render ( < Alert onClick = { ( ) => { } } message = "Error: Something went wrong" /> ) ;
28
26
29
- const alertDiv = screen
30
- . getByText ( / e r r o r : s o m e t h i n g w e n t w r o n g / i)
31
- . getByRole ( 'alert' ) ;
27
+ const alertDiv = screen . getByRole ( 'alert' ) ;
32
28
33
29
expect ( alertDiv ) . toHaveClass (
34
30
'bg-red-100' ,
You can’t perform that action at this time.
0 commit comments