mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-25 02:41:46 +08:00
[improvement] Picker: add test case
This commit is contained in:
parent
3a4b434b4c
commit
a72ce3d115
@ -41,3 +41,18 @@ exports[`render title slot 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`toolbar-position prop 1`] = `
|
||||||
|
<div class="van-picker">
|
||||||
|
<!---->
|
||||||
|
<!---->
|
||||||
|
<div class="van-picker__columns" style="height: 220px;">
|
||||||
|
<div class="van-picker__mask" style="background-size: 100% 88px;"></div>
|
||||||
|
<div class="van-hairline--top-bottom van-picker__frame" style="height: 44px;"></div>
|
||||||
|
</div>
|
||||||
|
<div class="van-hairline--top-bottom van-picker__toolbar">
|
||||||
|
<div role="button" tabindex="0" class="van-picker__cancel">取消</div>
|
||||||
|
<div role="button" tabindex="0" class="van-picker__confirm">确认</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
@ -181,3 +181,14 @@ test('click column\'s item', () => {
|
|||||||
wrapper.findAll('.van-picker-column__item').at(3).trigger('click');
|
wrapper.findAll('.van-picker-column__item').at(3).trigger('click');
|
||||||
expect(wrapper.emitted('change')[0][1]).toEqual(columns[1]);
|
expect(wrapper.emitted('change')[0][1]).toEqual(columns[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('toolbar-position prop', () => {
|
||||||
|
const wrapper = mount(Picker, {
|
||||||
|
propsData: {
|
||||||
|
showToolbar: true,
|
||||||
|
toolbarPosition: 'bottom'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(wrapper).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user