Files
vant/src/address-edit/test/__snapshots__/index.spec.js.snap
T
2021-05-06 20:29:35 +08:00

427 lines
11 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should allow to custom validator with validator prop 1`] = `
<div class="van-field__error-message">
foo name
</div>
`;
exports[`should render AddressEdit correctly 1`] = `
<div class="van-address-edit">
<div class="van-address-edit__fields">
<div class="van-cell van-field">
<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="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="Phone"
>
</div>
</div>
</div>
<div class="van-cell van-cell--clickable van-field"
role="button"
tabindex="0"
>
<div class="van-cell__title van-field__label">
<span>
Area
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="Area"
>
<div class="van-field__right-icon">
<i class="van-badge__wrapper van-icon van-icon-arrow">
</i>
</div>
</div>
</div>
</div>
<div class="van-cell van-field van-address-edit-detail">
<div class="van-cell__title van-field__label">
<span>
Address
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="Address"
>
</textarea>
</div>
</div>
</div>
</div>
<div class="van-address-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>
</div>
</div>
`;
exports[`should render AddressEdit with props correctly 1`] = `
<div class="van-address-edit">
<div class="van-address-edit__fields">
<div class="van-cell van-field">
<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="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="Phone"
>
</div>
</div>
</div>
<div class="van-cell van-cell--clickable van-field"
role="button"
tabindex="0"
>
<div class="van-cell__title van-field__label">
<span>
Area
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="Area"
>
<div class="van-field__right-icon">
<i class="van-badge__wrapper van-icon van-icon-arrow">
</i>
</div>
</div>
</div>
</div>
<div class="van-cell van-field van-address-edit-detail">
<div class="van-cell__title van-field__label">
<span>
Address
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="Address"
>
</textarea>
</div>
</div>
</div>
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>
Postal
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="Postal"
>
</div>
</div>
</div>
</div>
<div class="van-cell van-cell--center van-address-edit__default">
<div class="van-cell__title">
<span>
Set as the default address
</span>
</div>
<div role="switch"
class="van-switch van-switch--on"
style="font-size: 24px;"
aria-checked="true"
>
<div class="van-switch__node">
</div>
</div>
</div>
<div class="van-address-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>
</div>
</div>
`;
exports[`should valid address detail and render error message correctly 1`] = `
<div class="van-cell van-field van-address-edit-detail">
<div class="van-cell__title van-field__label">
<span>
Address
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="Address"
style="height: auto;"
>
</textarea>
</div>
<div class="van-field__error-message">
Address can not be empty
</div>
</div>
</div>
`;
exports[`should valid address detail and render error message correctly 2`] = `
<div class="van-cell van-field van-address-edit-detail">
<div class="van-cell__title van-field__label">
<span>
Address
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="Address"
style="height: auto;"
>
</textarea>
</div>
</div>
</div>
`;
exports[`should valid area code and render error message correctly 1`] = `
<div class="van-cell van-cell--clickable van-field"
role="button"
tabindex="0"
>
<div class="van-cell__title van-field__label">
<span>
Area
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="Area"
>
<div class="van-field__right-icon">
<i class="van-badge__wrapper van-icon van-icon-arrow">
</i>
</div>
</div>
<div class="van-field__error-message">
Please select a receiving area
</div>
</div>
</div>
`;
exports[`should valid area code and render error message correctly 2`] = `
<div class="van-cell van-cell--clickable van-field"
role="button"
tabindex="0"
>
<div class="van-cell__title van-field__label">
<span>
Area
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="Area"
>
<div class="van-field__right-icon">
<i class="van-badge__wrapper van-icon van-icon-arrow">
</i>
</div>
</div>
</div>
</div>
`;
exports[`should valid name and render error message correctly 1`] = `
<div class="van-cell van-field">
<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="Name"
>
</div>
<div class="van-field__error-message">
Please fill in the name
</div>
</div>
</div>
`;
exports[`should valid name and render error message correctly 2`] = `
<div class="van-cell van-field">
<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="Name"
>
</div>
</div>
</div>
`;
exports[`should valid postal code and render error message correctly 1`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>
Postal
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="Postal"
>
</div>
<div class="van-field__error-message">
Wrong postal code
</div>
</div>
</div>
`;
exports[`should valid postal code and render error message correctly 2`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>
Postal
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="Postal"
>
</div>
</div>
</div>
`;
exports[`should valid tel and render error message correctly 1`] = `
<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="Phone"
>
</div>
<div class="van-field__error-message">
Malformed phone number
</div>
</div>
</div>
`;
exports[`should valid tel and render error message correctly 2`] = `
<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="Phone"
>
</div>
</div>
</div>
`;