test(AddressEdit): update test cases

This commit is contained in:
chenjiahan
2021-01-11 21:03:32 +08:00
parent 6a184f8e93
commit 06df8092d1
2 changed files with 283 additions and 80 deletions
@@ -209,3 +209,217 @@ exports[`should render AddressEdit with props correctly 1`] = `
</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>
详细地址
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="街道门牌、楼层房间号等信息"
>
</textarea>
</div>
<div class="van-field__error-message">
请填写详细地址
</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>
详细地址
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<textarea rows="1"
class="van-field__control"
placeholder="街道门牌、楼层房间号等信息"
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>
地区
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="选择省 / 市 / 区"
>
<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">
请选择地区
</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>
地区
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
readonly
placeholder="选择省 / 市 / 区"
>
<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>
姓名
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
placeholder="收货人姓名"
>
</div>
<div class="van-field__error-message">
请填写姓名
</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>
姓名
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="text"
class="van-field__control"
placeholder="收货人姓名"
>
</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>
邮政编码
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="邮政编码"
>
</div>
<div class="van-field__error-message">
邮政编码格式不正确
</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>
邮政编码
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="邮政编码"
>
</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>
电话
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="收货人手机号"
>
</div>
<div class="van-field__error-message">
请输入正确的手机号
</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>
电话
</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<input type="tel"
class="van-field__control"
placeholder="收货人手机号"
>
</div>
</div>
</div>
`;