Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions jest/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ async function run(file, options = {}) {
describe('import directive', () => {
it('should add variants', async () => {
expect(await run('content/variants.html', { directive: 'import' })).toIncludeAll([
'.intersect\\:opacity-50 { &:not([no-intersect]) { opacity: 50%; } }',
'.intersect\\:hover\\:opacity-100 { &:not([no-intersect]) { &:hover { @media (hover: hover) { opacity: 100%; } } } }',
'.intersect\\:opacity-50:not([no-intersect]) { opacity: 50%; }',
'.intersect\\:hover\\:opacity-100:not([no-intersect]):hover { opacity: 100%; }',
])
})

it('should add arbitrary values', async () => {
expect(await run('content/arbitrary-values.html', { directive: 'import' })).toIncludeAll([
'.intersect\\:left-\\[100px\\] { &:not([no-intersect]) { left: 100px; } }',
'.intersect\\:left-\\(--my-value\\) { &:not([no-intersect]) { left: var(--my-value); } }',
'.intersect\\:left-\\[100px\\]:not([no-intersect]) { left: 100px; }',
'.intersect\\:left-\\(--my-value\\):not([no-intersect]) { left: var(--my-value); }',
])
})
})

describe('plugin directive', () => {
it('should add variants', async () => {
expect(await run('content/variants.html', { directive: 'plugin' })).toIncludeAll([
'.intersect\\:opacity-50 { &:not([no-intersect]) { opacity: 50%; } }',
'.intersect\\:hover\\:opacity-100 { &:not([no-intersect]) { &:hover { @media (hover: hover) { opacity: 100%; } } } }',
'.intersect\\:opacity-50:not([no-intersect]) { opacity: 50%; }',
'.intersect\\:hover\\:opacity-100:not([no-intersect]):hover { opacity: 100%; }',
])
})

it('should add arbitrary values', async () => {
expect(await run('content/arbitrary-values.html', { directive: 'plugin' })).toIncludeAll([
'.intersect\\:left-\\[100px\\] { &:not([no-intersect]) { left: 100px; } }',
'.intersect\\:left-\\(--my-value\\) { &:not([no-intersect]) { left: var(--my-value); } }',
'.intersect\\:left-\\[100px\\]:not([no-intersect]) { left: 100px; }',
'.intersect\\:left-\\(--my-value\\):not([no-intersect]) { left: var(--my-value); }',
])
})
})