提交 cd3bd3aa 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(component props): 补充 withDefaults 测试

上级 9320355f
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<text class="mb-10 bold">withDefaults</text> <text class="mb-10 bold">withDefaults</text>
<view class="mb-10 flex flex-row justify-between"> <view class="mb-10 flex flex-row justify-between">
<text>msg</text> <text>msg</text>
<text>{{ props.msg }}</text> <text id="prop-msg">{{ props.msg }}</text>
</view> </view>
<view class="mb-10 flex flex-row justify-between"> <view class="mb-10 flex flex-row justify-between">
<text>labels</text> <text>labels</text>
<text>{{ JSON.stringify(props.labels) }}</text> <text id="prop-labels">{{ JSON.stringify(props.labels) }}</text>
</view> </view>
</view> </view>
</template> </template>
......
...@@ -36,6 +36,11 @@ describe('props', () => { ...@@ -36,6 +36,11 @@ describe('props', () => {
const sameNamePropDefaultValueArr = await page.$('#same-name-prop-default-value-arr') const sameNamePropDefaultValueArr = await page.$('#same-name-prop-default-value-arr')
expect(await sameNamePropDefaultValueArr.text()).toBe('[1,2,3]') 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 () => { it('props 选项式 API', async () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册