@@ -30,7 +30,7 @@ describe("Some basic CSS is added.", () => {
30
30
render ( < App /> ) ;
31
31
const banner = screen . getByRole ( "banner" ) ;
32
32
expect ( banner ) . not . toHaveStyle ( {
33
- "background-color" : "rgb(40, 44, 52)"
33
+ "background-color" : "rgb(40, 44, 52)" ,
34
34
} ) ;
35
35
} ) ;
36
36
} ) ;
@@ -59,6 +59,25 @@ describe("Some Bootstrap Elements are added", () => {
59
59
} ) ;
60
60
} ) ;
61
61
62
- /**
63
- * Remember, there are additional tasks described on the page!
64
- */
62
+ describe ( "Some additional CSS was added" , ( ) => {
63
+ test ( "checks if any element has a background color of red" , ( ) => {
64
+ const { container } = render ( < App /> ) ;
65
+ // Get all elements in the rendered container
66
+ const elements = container . querySelectorAll ( "*" ) ;
67
+
68
+ // Check if any element has a background color of red
69
+ let foundRedBackground = false ;
70
+
71
+ elements . forEach ( ( element ) => {
72
+ const style = getComputedStyle ( element ) ;
73
+ if (
74
+ style . backgroundColor === "red" ||
75
+ style . backgroundColor === "rgb(255, 0, 0)"
76
+ ) {
77
+ foundRedBackground = true ;
78
+ }
79
+ } ) ;
80
+
81
+ expect ( foundRedBackground ) . toBe ( true ) ;
82
+ } ) ;
83
+ } ) ;
0 commit comments