]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: add missing edge case for css v-bind
authorEvan You <yyx990803@gmail.com>
Sun, 23 Jan 2022 13:03:37 +0000 (21:03 +0800)
committerEvan You <yyx990803@gmail.com>
Sun, 23 Jan 2022 13:03:37 +0000 (21:03 +0800)
packages/compiler-sfc/__tests__/__snapshots__/cssVars.spec.ts.snap
packages/compiler-sfc/__tests__/cssVars.spec.ts

index c290eb6feec3f2ef039eb6a9e93fa7440e5da3d3..49b0d712a7aa91a4bffd99177c8615bbde729d94 100644 (file)
@@ -75,6 +75,7 @@ export default {
 
 _useCssVars(_ctx => ({
   \\"xxxxxxxx-foo\\": (_unref(foo)),
+  \\"xxxxxxxx-foo____px_\\": (_unref(foo) + 'px'),
   \\"xxxxxxxx-_a___b____2____px_\\": ((_unref(a) + _unref(b)) / 2 + 'px'),
   \\"xxxxxxxx-__a___b______2___a_\\": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
 }))
index f92852e859f356df2f9bbb6320b8a9319d8fe646..d9912f44b514f5d6528a5edfb83dcac6884350e6 100644 (file)
@@ -210,6 +210,7 @@ describe('CSS vars injection', () => {
           p{
             width: calc(v-bind(foo) - 3px);
             height: calc(v-bind('foo') - 3px);
+            top: calc(v-bind(foo + 'px') - 3px);
           }
           div {
             color: v-bind((a + b) / 2 + 'px' );
@@ -224,6 +225,7 @@ describe('CSS vars injection', () => {
       )
       expect(content).toMatch(`_useCssVars(_ctx => ({
   "${mockId}-foo": (_unref(foo)),
+  "${mockId}-foo____px_": (_unref(foo) + 'px'),
   "${mockId}-_a___b____2____px_": ((_unref(a) + _unref(b)) / 2 + 'px'),
   "${mockId}-__a___b______2___a_": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
 })`)