feat(Stepper): add placeholder prop (#6519)

This commit is contained in:
neverland
2020-06-11 16:54:41 +08:00
committed by GitHub
parent febf17e546
commit 6de66e0455
7 changed files with 18 additions and 3 deletions
@@ -8,4 +8,6 @@ exports[`disabled stepper 1`] = `<div class="van-stepper"><button type="button"
exports[`input-width prop 1`] = `<div class="van-stepper"><button type="button" class="van-stepper__minus van-stepper__minus--disabled"></button><input type="text" role="spinbutton" inputmode="decimal" aria-valuemax="Infinity" aria-valuemin="1" aria-valuenow="1" class="van-stepper__input" style="width: 10rem;"><button type="button" class="van-stepper__plus"></button></div>`;
exports[`placeholder prop 1`] = `<input type="text" role="spinbutton" inputmode="decimal" placeholder="foo" aria-valuemax="Infinity" aria-valuemin="1" aria-valuenow="1" class="van-stepper__input">`;
exports[`show-plus & show-minus props 1`] = `<div class="van-stepper"><button type="button" class="van-stepper__minus van-stepper__minus--disabled" style="display: none;"></button><input type="text" role="spinbutton" inputmode="decimal" aria-valuemax="Infinity" aria-valuemin="1" aria-valuenow="1" class="van-stepper__input"><button type="button" class="van-stepper__plus" style="display: none;"></button></div>`;
+9
View File
@@ -378,3 +378,12 @@ test('change integer', async () => {
expect(wrapper.emitted('input')[0][0]).toEqual(1);
});
test('placeholder prop', () => {
const wrapper = mount(Stepper, {
propsData: {
placeholder: 'foo',
},
});
expect(wrapper.find('.van-stepper__input')).toMatchSnapshot();
});