test(Icon): add demo snapshot

This commit is contained in:
chenjiahan 2020-12-01 10:18:25 +08:00
parent 28afc8a521
commit 3107c83c04
3 changed files with 152 additions and 1 deletions

View File

@ -29,7 +29,7 @@
<demo-block :title="t('color')">
<van-row>
<van-col span="6" @click="copy(demoIcon, { color: '#1989fa' })">
<van-icon name="cart-o" :color="BLUE" />
<van-icon name="cart-o" color="#1989fa" />
</van-col>
<van-col span="6" @click="copy(demoIcon, { color: RED })">
<van-icon name="fire-o" :color="RED" />

View File

@ -0,0 +1,147 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render demo and match snapshot 1`] = `
<div class="van-tabs van-tabs--line"
modelvalue="0"
>
<div>
<div class="van-sticky">
<div class="van-tabs__wrap">
<div role="tablist"
class="van-tabs__nav van-tabs__nav--line"
>
<div role="tab"
class="van-tab van-tab--active"
aria-selected="true"
>
<span class="van-tab__text van-tab__text--ellipsis">
Demo
</span>
</div>
<div role="tab"
class="van-tab"
aria-selected="false"
>
<span class="van-tab__text van-tab__text--ellipsis">
Basic
</span>
</div>
<div role="tab"
class="van-tab"
aria-selected="false"
>
<span class="van-tab__text van-tab__text--ellipsis">
Outline
</span>
</div>
<div role="tab"
class="van-tab"
aria-selected="false"
>
<span class="van-tab__text van-tab__text--ellipsis">
Filled
</span>
</div>
<div class="van-tabs__line"
style="transform: translateX(0px) translateX(-50%);"
>
</div>
</div>
</div>
</div>
</div>
<div class="van-tabs__content">
<div role="tabpanel"
class="van-tab__pane"
style
>
<div>
<div class="van-row">
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o">
</i>
</div>
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon">
<img class="van-icon__image"
src="https://b.yzcdn.cn/vant/icon-demo-1126.png"
>
</i>
</div>
</div>
</div>
<div>
<div class="van-row">
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o">
<div class="van-badge van-badge--dot van-badge--fixed">
</div>
</i>
</div>
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o">
<div class="van-badge van-badge--fixed">
9
</div>
</i>
</div>
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o">
<div class="van-badge van-badge--fixed">
99+
</div>
</i>
</div>
</div>
</div>
<div>
<div class="van-row">
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-cart-o"
style="color: rgb(25, 137, 250);"
>
</i>
</div>
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-fire-o"
style="color: rgb(238, 10, 36);"
>
</i>
</div>
</div>
</div>
<div>
<div class="van-row">
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o"
style="font-size: 40px;"
>
</i>
</div>
<div class="van-col van-col--6">
<i class="van-badge__wrapper van-icon van-icon-chat-o"
style="font-size: 3rem;"
>
</i>
</div>
</div>
</div>
</div>
<div role="tabpanel"
class="van-tab__pane"
style="display: none;"
>
</div>
<div role="tabpanel"
class="van-tab__pane"
style="display: none;"
>
</div>
<div role="tabpanel"
class="van-tab__pane"
style="display: none;"
>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Demo from '../demo';
import { snapshotDemo } from '../../../test/demo';
snapshotDemo(Demo);