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 {
132132
133133 const elStyle = window . getComputedStyle ( this . element ) [ style ]
134134 const mockNodeStyle = window . getComputedStyle ( mockNode ) [ style ]
135- return elStyle === mockNodeStyle
135+ return ! ! ( elStyle && mockNodeStyle && elStyle === mockNodeStyle )
136136 }
137137
138138 /**
Original file line number Diff line number Diff line change @@ -53,4 +53,12 @@ describe('hasStyle', () => {
5353 const fn = ( ) => wrapper . hasStyle ( 'color' , undefined )
5454 expect ( fn ) . to . throw ( ) . with . property ( 'message' , message )
5555 } )
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+ } )
5664} )
You can’t perform that action at this time.
0 commit comments