Skip to content

Commit

Permalink
Revert test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Jul 15, 2020
1 parent 4169bb1 commit 68a0479
Showing 1 changed file with 10 additions and 66 deletions.
76 changes: 10 additions & 66 deletions __tests__/responsiveAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('it can generate responsive variants', () => {
.chocolate { color: brown; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -55,7 +55,7 @@ test('it can generate responsive variants with a custom separator', () => {
.chocolate { color: brown; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -97,7 +97,7 @@ test('it can generate responsive variants when classes have non-standard charact
.chocolate-2\\.5 { color: brown; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -144,7 +144,7 @@ test('responsive variants are grouped', () => {
.chocolate { color: brown; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -190,7 +190,7 @@ test('it can generate responsive variants for nested at-rules', () => {
}
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -255,7 +255,7 @@ test('it can generate responsive variants for deeply nested at-rules', () => {
}
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -320,7 +320,7 @@ test('screen prefix is only applied to the last class in a selector', () => {
.banana li * .sandwich #foo > div { color: yellow; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -357,7 +357,7 @@ test('responsive variants are generated for all selectors in a rule', () => {
.foo, .bar { color: yellow; }
}
@screens utilities;
@tailwind screens;
`

const output = `
Expand Down Expand Up @@ -394,7 +394,7 @@ test('selectors with no classes cannot be made responsive', () => {
div { color: yellow; }
}
@screens utilities;
@tailwind screens;
`
expect.assertions(1)
return run(input, {
Expand All @@ -417,7 +417,7 @@ test('all selectors in a rule must contain classes', () => {
.foo, div { color: yellow; }
}
@screens utilities;
@tailwind screens;
`
expect.assertions(1)
return run(input, {
Expand All @@ -433,59 +433,3 @@ test('all selectors in a rule must contain classes', () => {
expect(e).toMatchObject({ name: 'CssSyntaxError' })
})
})

test('responsive components are inserted at @screens components', () => {
const input = `
@responsive components {
.banana { color: yellow; }
}
.apple { color: red; }
@screens components;
@responsive {
.chocolate { color: brown; }
}
@screens utilities;
`

const output = `
.banana { color: yellow; }
.apple { color: red; }
@media (min-width: 500px) {
.sm\\:banana { color: yellow; }
}
@media (min-width: 750px) {
.md\\:banana { color: yellow; }
}
@media (min-width: 1000px) {
.lg\\:banana { color: yellow; }
}
.chocolate { color: brown; }
@media (min-width: 500px) {
.sm\\:chocolate { color: brown; }
}
@media (min-width: 750px) {
.md\\:chocolate { color: brown; }
}
@media (min-width: 1000px) {
.lg\\:chocolate { color: brown; }
}
`

return run(input, {
theme: {
screens: {
sm: '500px',
md: '750px',
lg: '1000px',
},
},
separator: ':',
}).then(result => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
})

0 comments on commit 68a0479

Please sign in to comment.