PayOrder: improve test coverage

This commit is contained in:
陈嘉涵 2017-08-29 16:09:03 +08:00
parent 0eed2d35d8
commit ccc4fc3861
2 changed files with 6 additions and 13 deletions

View File

@ -2,7 +2,7 @@
<div class="van-pay-order">
<div class="van-pay-order__tip" v-show="tip">{{ tip }}</div>
<div class="van-pay-order__bar">
<div class="van-pay-order__price">
<div class="van-pay-order__price" v-if="typeof price === 'number'">
<span class="van-pay-order__price-text">合计</span>
<span class="van-pay-order__price-interger">¥{{ priceInterger }}.</span>
<span class="van-pay-order__price-decimal">{{ priceDecimal }}</span>
@ -26,19 +26,13 @@ export default {
props: {
tip: String,
disabled: Boolean,
type: Number,
loading: Boolean,
buttonText: {
type: String,
required: true
},
disabled: Boolean,
buttonText: String,
buttonType: {
type: String,
default: 'danger'
},
price: {
type: Number,
required: true
}
},

View File

@ -33,7 +33,8 @@ describe('PayOrder', () => {
wrapper = mount(PayOrder, {
propsData: {
price: 3005,
buttonText: '提交订单'
buttonText: '提交订单',
buttonType: 'normal'
}
});
@ -66,7 +67,6 @@ describe('PayOrder', () => {
it('can not submit when disabled', () => {
wrapper = mount(PayOrder, {
propsData: {
price: 3005,
disabled: true,
buttonText: '提交订单'
}
@ -83,7 +83,6 @@ describe('PayOrder', () => {
it('can not submit when loading', () => {
wrapper = mount(PayOrder, {
propsData: {
price: 3005,
loading: true,
buttonText: '提交订单'
}