Extract output constants
This commit is contained in:
parent
388eb307ca
commit
98021467bf
40
test.js
40
test.js
|
@ -21,29 +21,33 @@ expect.extend({
|
||||||
})
|
})
|
||||||
|
|
||||||
test('it generates the correct classes with no variants', () => {
|
test('it generates the correct classes with no variants', () => {
|
||||||
|
const output = `
|
||||||
|
.test {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
generatePluginCss().then(result => {
|
generatePluginCss().then(result => {
|
||||||
expect(result.css).toMatchCss(`
|
expect(result.css).toMatchCss(output)
|
||||||
.test {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test('it generates the correct classes with variants', () => {
|
test('it generates the correct classes with variants', () => {
|
||||||
|
const output = `
|
||||||
|
.test {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
.hover\\:test:hover {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
.focus\\:test:focus {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
generatePluginCss({ variants: ['hover', 'focus'] }).then(result => {
|
generatePluginCss({ variants: ['hover', 'focus'] }).then(result => {
|
||||||
expect(result.css).toMatchCss(`
|
expect(result.css).toMatchCss(output)
|
||||||
.test {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
|
|
||||||
.hover\\:test:hover {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
|
|
||||||
.focus\\:test:focus {
|
|
||||||
display: block
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue