Skip to content

Commit 2eba99f

Browse files
committed
fix tests
1 parent 5f6b76d commit 2eba99f

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

packages/style/src/plugins/__tests__/sortProperty.test.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
 (0)