Преглед изворни кода

test(compiler-sfc): direct descendant wildcard rule selector (#13411)

add test case for #13387
btea пре 11 месеци
родитељ
комит
62f2aa11a2
1 измењених фајлова са 18 додато и 0 уклоњено
  1. 18 0
      packages/compiler-sfc/__tests__/compileStyle.spec.ts

+ 18 - 0
packages/compiler-sfc/__tests__/compileStyle.spec.ts

@@ -39,6 +39,24 @@ describe('SFC scoped CSS', () => {
     expect(compileScoped(`h1 .foo { color: red; }`)).toMatch(
       `h1 .foo[data-v-test] { color: red;`,
     )
+
+    // #13387
+    expect(
+      compileScoped(`main {
+  width: 100%;
+  > * {
+    max-width: 200px;
+  }
+}`),
+    ).toMatchInlineSnapshot(`
+      "main {
+&[data-v-test] {
+  width: 100%;
+}
+> *[data-v-test] {
+    max-width: 200px;
+}
+}"`)
   })
 
   test('nesting selector', () => {