From c73d889235485a9249b13bbf48095502a0bc800f Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 19 Dec 2019 12:07:47 -0500 Subject: [PATCH] test(sfc): test @media and @supports query for scoped css --- .../compiler-sfc/__tests__/stylePluginScoped.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts b/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts index a618ef61..ed24199a 100644 --- a/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts +++ b/packages/compiler-sfc/__tests__/stylePluginScoped.spec.ts @@ -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 {