From cd3bd3aaa18e7fea0f4557b465834a9074400802 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Wed, 29 May 2024 20:11:33 +0800
Subject: [PATCH] =?UTF-8?q?test(component=20props):=20=E8=A1=A5=E5=85=85?=
=?UTF-8?q?=20withDefaults=20=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/component-instance/props/props-with-defaults.uvue | 4 ++--
pages/component-instance/props/props.test.js | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pages/component-instance/props/props-with-defaults.uvue b/pages/component-instance/props/props-with-defaults.uvue
index c560943..2543cd8 100644
--- a/pages/component-instance/props/props-with-defaults.uvue
+++ b/pages/component-instance/props/props-with-defaults.uvue
@@ -3,11 +3,11 @@
withDefaults
msg
- {{ props.msg }}
+ {{ props.msg }}
labels
- {{ JSON.stringify(props.labels) }}
+ {{ JSON.stringify(props.labels) }}
diff --git a/pages/component-instance/props/props.test.js b/pages/component-instance/props/props.test.js
index a9fd18c..7e453ec 100644
--- a/pages/component-instance/props/props.test.js
+++ b/pages/component-instance/props/props.test.js
@@ -36,6 +36,11 @@ describe('props', () => {
const sameNamePropDefaultValueArr = await page.$('#same-name-prop-default-value-arr')
expect(await sameNamePropDefaultValueArr.text()).toBe('[1,2,3]')
+
+ const propMsg = await page.$('#prop-msg')
+ expect(await propMsg.text()).toBe('hello')
+ const propLabels = await page.$('#prop-labels')
+ expect(await propLabels.text()).toBe('["a","b"]')
}
it('props 选项式 API', async () => {
--
GitLab