]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(compiler-sfc): direct descendant wildcard rule selector (#13411)
authorbtea <2356281422@qq.com>
Fri, 30 May 2025 02:35:27 +0000 (10:35 +0800)
committerGitHub <noreply@github.com>
Fri, 30 May 2025 02:35:27 +0000 (10:35 +0800)
add test case for #13387

packages/compiler-sfc/__tests__/compileStyle.spec.ts

index 78fd52425e8ffe7dfa30658c57f9d9e3aac9c689..9b7e7c53710bda71c91687875cd664a80cb61d99 100644 (file)
@@ -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', () => {