test: fix snapshot

This commit is contained in:
chenjiahan 2020-12-02 09:39:36 +08:00
parent ba11e3f249
commit 5de2acd964
4 changed files with 141 additions and 149 deletions

View File

@ -1,16 +1,14 @@
<template> <template>
<demo-section> <demo-block :title="t('basicUsage')">
<demo-block :title="t('basicUsage')"> <van-contact-edit
<van-contact-edit is-edit
is-edit show-set-default
show-set-default :contact-info="editingContact"
:contact-info="editingContact" :set-default-label="t('defaultLabel')"
:set-default-label="t('defaultLabel')" @save="onSave"
@save="onSave" @delete="onDelete"
@delete="onDelete" />
/> </demo-block>
</demo-block>
</demo-section>
</template> </template>
<script> <script>

View File

@ -2,76 +2,74 @@
exports[`should render demo and match snapshot 1`] = ` exports[`should render demo and match snapshot 1`] = `
<div> <div>
<div> <div class="van-contact-edit">
<div class="van-contact-edit"> <div class="van-contact-edit__fields">
<div class="van-contact-edit__fields"> <div class="van-cell van-field">
<div class="van-cell van-field"> <div class="van-cell__title van-field__label">
<div class="van-cell__title van-field__label">
<span>
Name
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
placeholder="Please fill in the name"
>
</div>
</div>
</div>
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>
Phone
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="Please fill in the tel"
>
</div>
</div>
</div>
</div>
<div class="van-cell van-cell--borderless van-contact-edit__switch-cell">
<div class="van-cell__title">
<span> <span>
Set as the default contact Name
</span> </span>
</div> </div>
<div role="switch" <div class="van-cell__value van-field__value">
class="van-switch" <div class="van-field__body">
style="font-size: 24px;" <input type="text"
aria-checked="false" class="van-field__control"
> placeholder="Please fill in the name"
<div class="van-switch__node"> >
</div> </div>
</div> </div>
</div> </div>
<div class="van-contact-edit__buttons"> <div class="van-cell van-field">
<button type="button" <div class="van-cell__title van-field__label">
class="van-button van-button--danger van-button--normal van-button--block van-button--round" <span>
> Phone
<div class="van-button__content"> </span>
<span class="van-button__text"> </div>
Save <div class="van-cell__value van-field__value">
</span> <div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="Please fill in the tel"
>
</div> </div>
</button> </div>
<button type="button"
class="van-button van-button--default van-button--normal van-button--block van-button--round"
>
<div class="van-button__content">
<span class="van-button__text">
Delete
</span>
</div>
</button>
</div> </div>
</div> </div>
<div class="van-cell van-cell--borderless van-contact-edit__switch-cell">
<div class="van-cell__title">
<span>
Set as the default contact
</span>
</div>
<div role="switch"
class="van-switch"
style="font-size: 24px;"
aria-checked="false"
>
<div class="van-switch__node">
</div>
</div>
</div>
<div class="van-contact-edit__buttons">
<button type="button"
class="van-button van-button--danger van-button--normal van-button--block van-button--round"
>
<div class="van-button__content">
<span class="van-button__text">
Save
</span>
</div>
</button>
<button type="button"
class="van-button van-button--default van-button--normal van-button--block van-button--round"
>
<div class="van-button__content">
<span class="van-button__text">
Delete
</span>
</div>
</button>
</div>
</div> </div>
</div> </div>
`; `;

View File

@ -1,16 +1,14 @@
<template> <template>
<demo-section> <demo-block :title="t('basicUsage')">
<demo-block :title="t('basicUsage')"> <van-contact-list
<van-contact-list v-model="chosenContactId"
v-model="chosenContactId" :list="t('list')"
:list="t('list')" :default-tag-text="t('defaultTagText')"
:default-tag-text="t('defaultTagText')" @add="onAdd"
@add="onAdd" @edit="onEdit"
@edit="onEdit" @select="onSelect"
@select="onSelect" />
/> </demo-block>
</demo-block>
</demo-section>
</template> </template>
<script> <script>

View File

@ -2,74 +2,72 @@
exports[`should render demo and match snapshot 1`] = ` exports[`should render demo and match snapshot 1`] = `
<div> <div>
<div> <div class="van-contact-list">
<div class="van-contact-list"> <div class="van-radio-group van-contact-list__group"
<div class="van-radio-group van-contact-list__group" role="radiogroup"
role="radiogroup" >
<div class="van-cell van-cell--center van-cell--clickable van-contact-list__item"
role="button"
tabindex="0"
> >
<div class="van-cell van-cell--center van-cell--clickable van-contact-list__item" <i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
role="button" </i>
tabindex="0" <div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
> John Snow13000000000
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit"> <transition-stub class="van-contact-list__item-tag">
</i> <span class="van-tag van-tag--round van-tag--danger">
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value"> default
John Snow13000000000
<transition-stub class="van-contact-list__item-tag">
<span class="van-tag van-tag--round van-tag--danger">
default
</span>
</transition-stub>
</div>
<div role="radio"
class="van-radio"
tabindex="0"
aria-checked="true"
>
<div class="van-radio__icon van-radio__icon--round van-radio__icon--checked"
style="font-size: 16px;"
>
<i class="van-badge__wrapper van-icon van-icon-success"
style="border-color: #ee0a24; background-color: rgb(238, 10, 36);"
>
</i>
</div>
</div>
</div>
<div class="van-cell van-cell--center van-cell--clickable van-contact-list__item"
role="button"
tabindex="0"
>
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
Ned Stark1310000000
</div>
<div role="radio"
class="van-radio"
tabindex="0"
aria-checked="false"
>
<div class="van-radio__icon van-radio__icon--round"
style="font-size: 16px;"
>
<i class="van-badge__wrapper van-icon van-icon-success">
</i>
</div>
</div>
</div>
</div>
<div class="van-contact-list__bottom">
<button type="button"
class="van-button van-button--danger van-button--normal van-button--block van-button--round van-contact-list__add"
>
<div class="van-button__content">
<span class="van-button__text">
Add new contact
</span> </span>
</transition-stub>
</div>
<div role="radio"
class="van-radio"
tabindex="0"
aria-checked="true"
>
<div class="van-radio__icon van-radio__icon--round van-radio__icon--checked"
style="font-size: 16px;"
>
<i class="van-badge__wrapper van-icon van-icon-success"
style="border-color: #ee0a24; background-color: rgb(238, 10, 36);"
>
</i>
</div> </div>
</button> </div>
</div> </div>
<div class="van-cell van-cell--center van-cell--clickable van-contact-list__item"
role="button"
tabindex="0"
>
<i class="van-badge__wrapper van-icon van-icon-edit van-contact-list__edit">
</i>
<div class="van-cell__value van-cell__value--alone van-contact-list__item-value">
Ned Stark1310000000
</div>
<div role="radio"
class="van-radio"
tabindex="0"
aria-checked="false"
>
<div class="van-radio__icon van-radio__icon--round"
style="font-size: 16px;"
>
<i class="van-badge__wrapper van-icon van-icon-success">
</i>
</div>
</div>
</div>
</div>
<div class="van-contact-list__bottom">
<button type="button"
class="van-button van-button--danger van-button--normal van-button--block van-button--round van-contact-list__add"
>
<div class="van-button__content">
<span class="van-button__text">
Add new contact
</span>
</div>
</button>
</div> </div>
</div> </div>
</div> </div>