]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(sfc): test @media and @supports query for scoped css
authorEvan You <yyx990803@gmail.com>
Thu, 19 Dec 2019 17:07:47 +0000 (12:07 -0500)
committerEvan You <yyx990803@gmail.com>
Thu, 19 Dec 2019 19:19:58 +0000 (14:19 -0500)
packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts

index a618ef618eb59636b1decc4f5f068d1bac6239ef..ed24199a509f723b1f384e2d94eb75f24db79b01 100644 (file)
@@ -91,6 +91,18 @@ describe('SFC scoped CSS', () => {
     )
   })
 
+  test('media query', () => {
+    expect(compile(`@media print { .foo { color: red }}`)).toMatch(
+      /@media print {\s+\.foo\[test\] \{ color: red/
+    )
+  })
+
+  test('supports query', () => {
+    expect(
+      compile(`@supports(display: grid) { .foo { display: grid }}`)
+    ).toMatch(/@supports\(display: grid\) {\s+\.foo\[test\] \{ display: grid/)
+  })
+
   test('scoped keyframes', () => {
     const style = compile(`
 .anim {