[new feature] SubmitBar: add decimal-length prop (#3151)

This commit is contained in:
neverland
2019-04-15 17:59:56 +08:00
committed by GitHub
parent ae73af819d
commit ffe82e2f06
6 changed files with 40 additions and 8 deletions
+15 -2
View File
@@ -6,7 +6,7 @@ test('submit', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
price: 0.01
price: 1
},
on: { submit }
}
@@ -22,7 +22,7 @@ test('disable submit', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
price: 0.01,
price: 1,
disabled: true
},
on: { submit }
@@ -36,3 +36,16 @@ test('disable submit', () => {
button.trigger('click');
expect(submit).toHaveBeenCalledTimes(0);
});
test('decimal length', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
price: 111,
decimalLength: 1
}
}
});
expect(wrapper).toMatchSnapshot();
});