@@ -21,15 +21,20 @@ class StyleTest {
2121
2222 expect(button).toHaveStyle(" display: none" )
2323 expect(button).toHaveStyle(mapOf (" display" to " none" ))
24+
25+ val backgroundColor = when (System .getenv(" BROWSER" )) {
26+ " firefox" -> " rgb(255, 0, 0)"
27+ else -> " rgba(255, 0, 0, 1)"
28+ }
2429 expect(button).toHaveStyle(
2530 """
26- background-color: rgba(255, 0, 0, 1) ;
31+ background-color: ${backgroundColor} ;
2732 display: none;
2833 """
2934 )
3035 expect(button).toHaveStyle(
3136 mapOf (
32- " backgroundColor" to " rgba(255, 0, 0, 1) " , // why?
37+ " backgroundColor" to backgroundColor , // why?
3338 " display" to " none" ,
3439 )
3540 )
@@ -39,9 +44,14 @@ class StyleTest {
3944 " display" to " none" ,
4045 )
4146 )
47+
48+ val wrongBackgroundColor = when (System .getenv(" BROWSER" )) {
49+ " firefox" -> " rgb(0, 0, 255)"
50+ else -> " rgba(0, 0, 255, 1)"
51+ }
4252 expect(button).not .toHaveStyle(
4353 mapOf (
44- " backgroundColor" to " rgba(0, 0, 255, 1) " ,
54+ " backgroundColor" to wrongBackgroundColor ,
4555 " display" to " none" ,
4656 )
4757 )
0 commit comments