Skip to content

Commit

Permalink
add additional tests (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartveneman authored Sep 13, 2024
1 parent 27ee720 commit 09c01c0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/atrules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ test('@media prelude formatting', () => {
`@media all and (-webkit-min-device-pixel-ratio: 10000), not all and (-webkit-min-device-pixel-ratio: 0) {}`,
],
['@supports selector([popover]:open) {}', '@supports selector([popover]:open) {}'],
['@import url("fineprint.css") print;', '@import url("fineprint.css") print;'],
['@import url("style.css") layer;', '@import url("style.css") layer;'],
['@import url("style.css") layer(test.first) supports(display:grid);', '@import url("style.css") layer(test.first) supports(display: grid);'],
]

for (let [css, expected] of fixtures) {
Expand All @@ -91,6 +94,28 @@ test('@media prelude formatting', () => {
}
})

test.skip('lowercases functions inside atrule preludes', () => {
let actual = format(`
@import URL("style.css") LAYER(test) SUPPORTS(display:grid);
@supports SELECTOR([popover]:open) {}
`)
let expected = `@import url("style.css") layer(test) supports(display: grid);
@supports selector([popover]:open) {}`
assert.equal(actual, expected)
})

test('formats @scope', () => {
let actual = format(`
@scope (.light-scheme) {}
@scope (.media-object) to (.content > *) {}
`)
let expected = `@scope (.light-scheme) {}
@scope (.media-object) to (.content > *) {}`
assert.equal(actual, expected)
})

test.skip('calc() inside @media', () => {
let actual = format(`
@media (min-width: calc(300px* 3)) {}
Expand Down

0 comments on commit 09c01c0

Please sign in to comment.