[new feature] CouponList: add empty-image prop (#3941)
This commit is contained in:
@@ -1,5 +1,38 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`empty-image prop 1`] = `
|
||||
<div class="van-coupon-list">
|
||||
<div class="van-cell van-cell--borderless van-field van-coupon-list__field">
|
||||
<div class="van-cell__value van-cell__value--alone">
|
||||
<div class="van-field__body"><input type="text" placeholder="请输入优惠码" maxlength="20" class="van-field__control">
|
||||
<div class="van-field__button"><button disabled="disabled" class="van-button van-button--danger van-button--small van-button--disabled van-coupon-list__exchange"><span class="van-button__text">兑换</span></button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs van-tabs--line van-coupon-list__tab">
|
||||
<div class="van-tabs__wrap van-hairline--top-bottom">
|
||||
<div role="tablist" class="van-tabs__nav van-tabs__nav--line">
|
||||
<div role="tab" aria-selected="true" class="van-tab van-tab--active"><span class="van-ellipsis">可使用优惠券 (0)</span></div>
|
||||
<div role="tab" class="van-tab"><span class="van-ellipsis">不可使用优惠券 (0)</span></div>
|
||||
<div class="van-tabs__line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs__content">
|
||||
<div role="tabpanel" class="van-tab__pane">
|
||||
<div class="van-coupon-list__list" style="height: 628px;">
|
||||
<div class="van-coupon-list__empty"><img src="https://img.yzcdn.com/xxx.png">
|
||||
<p>暂无优惠券</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="van-tab__pane" style="display: none;">
|
||||
<!---->
|
||||
</div>
|
||||
</div>
|
||||
</div><button class="van-button van-button--default van-button--large van-coupon-list__close"><span class="van-button__text">不使用优惠</span></button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`render coupon cell 1`] = `
|
||||
<div class="van-cell van-cell--clickable van-coupon-cell">
|
||||
<div class="van-cell__title"><span>优惠券</span></div>
|
||||
|
||||
@@ -102,6 +102,16 @@ test('render empty coupon list', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('empty-image prop', () => {
|
||||
const wrapper = mount(CouponList, {
|
||||
propsData: {
|
||||
emptyImage: 'https://img.yzcdn.com/xxx.png'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('exchange coupon', () => {
|
||||
const wrapper = mount(CouponList);
|
||||
const exchange = wrapper.find('.van-coupon-list__exchange');
|
||||
|
||||
Reference in New Issue
Block a user