mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[new feature] SubmitBar: add suffix-label prop
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user