forked from jevakallio/css-properly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.test.js
44 lines (37 loc) · 1.03 KB
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
let postcss = require('postcss')
let plugin = require('./')
async function run (input, output, opts) {
let result = await postcss([plugin(opts)]).process(input, { from: undefined })
expect(result.css).toEqual(output)
expect(result.warnings()).toHaveLength(0)
}
it('translates "colour" prop to "color"', async () => {
await run(
'div{ colour: red }',
'div{ color: red }', { }
)
})
it('translates props including "colour" to "color"', async () => {
await run(
'div{ background-colour: red }',
'div{ background-color: red }', { }
)
})
it('translates values including "centre" to "center"', async () => {
await run(
'div{ text-align: centre }',
'div{ text-align: center }', { }
)
})
it('translates "padding-ton" prop to "padding-top"', async () => {
await run(
'div{ padding-ton: 10px }',
'div{ padding-top: 10px }', { }
)
})
it('translates "capitalise" prop to "capitalize"', async () => {
await run(
'div{ text-transform: capitalise }',
'div{ text-transform: capitalize }', { }
)
})