[new feature] SubmitBar: add suffix-label prop

This commit is contained in:
陈嘉涵
2019-05-10 11:37:22 +08:00
parent 19efe4b316
commit 0f68edb8fd
7 changed files with 100 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
import SubmitBar from '..';
import { mount } from '../../../test/utils';
test('submit', () => {
test('submit event', () => {
const submit = jest.fn();
const wrapper = mount(SubmitBar, {
context: {
@@ -37,7 +37,29 @@ test('disable submit', () => {
expect(submit).toHaveBeenCalledTimes(0);
});
test('decimal length', () => {
test('without price', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
label: 'Label'
}
}
});
expect(wrapper).toMatchSnapshot();
});
test('top slot', () => {
const wrapper = mount(SubmitBar, {
scopedSlots: {
top: () => 'top'
}
});
expect(wrapper).toMatchSnapshot();
});
test('decimal-length prop', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
@@ -49,3 +71,17 @@ test('decimal length', () => {
expect(wrapper).toMatchSnapshot();
});
test('suffix-label prop', () => {
const wrapper = mount(SubmitBar, {
context: {
props: {
price: 111,
label: 'Label',
suffixLabel: 'Suffix Label'
}
}
});
expect(wrapper).toMatchSnapshot();
});