File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` .toHaveStyle handles negative test cases 1` ] = `
4
+ "<dim >expect(</><red >element</><dim >).toHaveStyle()</>
5
+
6
+ <green >- Expected</>
7
+
8
+ <dim > backgroundColor: blue;</>
9
+ <dim > transform: [</>
10
+ <dim > { < / >
11
+ <green >- \\"scale\\": 1</>
12
+ <red >+ \\"scale\\": 2</>
13
+ <dim > }</>
14
+ <dim > ];</>"
15
+ `;
16
+
17
+ exports[`.toHaveStyle handles transform when transform undefined 1`] = `
18
+ "<dim >expect(</><red >element</><dim >).toHaveStyle()</>
19
+
20
+ <green >- Expected</>
21
+
22
+ <green >- transform: [</>
23
+ <green >- { < / >
24
+ <green >- \\"scale\\": 1</>
25
+ <green >- }</>
26
+ <green >- ];</>
27
+ <red >+ transform: undefined;</>"
28
+ `;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe('.toHaveStyle', () => {
52
52
const container = getByTestId ( 'container' ) ;
53
53
expect ( ( ) =>
54
54
expect ( container ) . toHaveStyle ( { backgroundColor : 'blue' , transform : [ { scale : 1 } ] } ) ,
55
- ) . toThrowError ( ) ;
55
+ ) . toThrowErrorMatchingSnapshot ( ) ;
56
56
expect ( ( ) => expect ( container ) . toHaveStyle ( { fontWeight : 'bold' } ) ) . toThrowError ( ) ;
57
57
expect ( ( ) => expect ( container ) . not . toHaveStyle ( { color : 'black' } ) ) . toThrowError ( ) ;
58
58
} ) ;
@@ -83,6 +83,8 @@ describe('.toHaveStyle', () => {
83
83
) ;
84
84
85
85
const container = getByTestId ( 'container' ) ;
86
- expect ( ( ) => expect ( container ) . toHaveStyle ( { transform : [ { scale : 1 } ] } ) ) . toThrowError ( ) ;
86
+ expect ( ( ) =>
87
+ expect ( container ) . toHaveStyle ( { transform : [ { scale : 1 } ] } ) ,
88
+ ) . toThrowErrorMatchingSnapshot ( ) ;
87
89
} ) ;
88
90
} ) ;
You can’t perform that action at this time.
0 commit comments