File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
test/unit/specs/mount/Wrapper Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export default class Wrapper implements BaseWrapper {
132
132
133
133
const elStyle = window . getComputedStyle ( this . element ) [ style ]
134
134
const mockNodeStyle = window . getComputedStyle ( mockNode ) [ style ]
135
- return elStyle === mockNodeStyle
135
+ return ! ! ( elStyle && mockNodeStyle && elStyle === mockNodeStyle )
136
136
}
137
137
138
138
/**
Original file line number Diff line number Diff line change @@ -53,4 +53,12 @@ describe('hasStyle', () => {
53
53
const fn = ( ) => wrapper . hasStyle ( 'color' , undefined )
54
54
expect ( fn ) . to . throw ( ) . with . property ( 'message' , message )
55
55
} )
56
+
57
+ it ( 'return false when the style is a invalid prop name ' , ( ) => {
58
+ if ( navigator . userAgent . includes && navigator . userAgent . includes ( 'jsdom' ) ) {
59
+ return
60
+ }
61
+ const wrapper = mount ( ComponentWithStyle )
62
+ expect ( wrapper . find ( 'p' ) . hasStyle ( 'margin-top333' , '10px' ) ) . to . equal ( false )
63
+ } )
56
64
} )
You can’t perform that action at this time.
0 commit comments