Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Sep 12, 2024
1 parent 77b9adf commit 5a332a0
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/compiler-sfc/__tests__/compileStyle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,27 @@ describe('SFC scoped CSS', () => {
})

test('nesting selector', () => {
expect(compileScoped(`h1 { color: red; .foo { color: red; } }`)).toMatch(
`h1 {\n&[data-v-test] { color: red;\n}\n.foo[data-v-test] { color: red;`,
expect(
compileScoped(
'h1 { \n' +
' color: red; \n' +
' /**background-color: pink; */ \n' +
' @media only screen and (max-width: 800px) { \n' +
' background-color: green; \n' +
' } \n' +
' .foo { color: red; }' +
'} \n',
),
).toMatch(
`h1 {
&[data-v-test] {
color: red;
/**background-color: pink; */
@media only screen and (max-width: 800px) {
background-color: green;
}}
.foo[data-v-test] { color: red;
}} `,
)
})

Expand Down

0 comments on commit 5a332a0

Please sign in to comment.