File tree Expand file tree Collapse file tree
packages/style/src/plugins/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,28 +58,29 @@ describe('sortPropertyPlugin', () => {
5858 const plugin = sortPropertyPlugin ( {
5959 padding : 1 ,
6060 paddingLeft : 2 ,
61- } as any )
61+ } )
6262
63- const style = { padding : 'second' , paddingLeft : 'first' }
63+ const style = { padding : 10 , paddingLeft : 20 }
6464
65- const result = plugin ( style as any )
65+ const result = plugin ( style )
6666
67- expect ( result . padding ) . toBe ( 'first' )
68- expect ( result . paddingLeft ) . toBe ( 'second' )
67+ expect ( Object . keys ( result ) ) . toEqual ( [ 'padding' , 'paddingLeft' ] )
6968 } )
7069
7170 test ( 'handles equal priorities' , ( ) => {
7271 const plugin = sortPropertyPlugin ( {
7372 margin : 1 ,
7473 padding : 1 ,
75- } as any )
76-
77- const style = { padding : 10 , margin : 5 }
78-
79- const result = plugin ( style as any )
74+ } )
8075
8176 // Both have same priority, order may vary but both should exist
82- expect ( result . margin ) . toBe ( 5 )
83- expect ( result . padding ) . toBe ( 10 )
77+ expect ( Object . keys ( plugin ( { padding : 10 , margin : 5 } ) ) ) . toEqual ( [
78+ 'padding' ,
79+ 'margin' ,
80+ ] )
81+ expect ( Object . keys ( plugin ( { margin : 5 , padding : 10 } ) ) ) . toEqual ( [
82+ 'margin' ,
83+ 'padding' ,
84+ ] )
8485 } )
8586} )
You can’t perform that action at this time.
0 commit comments