feat(PullRefresh): add pull-distance prop (#8280)
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should allow to custom pull distance 1`] = `
|
||||
<div class="van-pull-refresh">
|
||||
<div class="van-pull-refresh__track"
|
||||
style="transition-duration: 0ms; transform: translate3d(0,100px, 0);"
|
||||
>
|
||||
<div class="van-pull-refresh__head">
|
||||
<div class="van-pull-refresh__text">
|
||||
Pull to refresh...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`should render different head content in different pulling status 1`] = `
|
||||
<div class="van-pull-refresh">
|
||||
<div class="van-pull-refresh__track"
|
||||
|
||||
@@ -150,3 +150,17 @@ test('should set height when using head-height', async () => {
|
||||
const head = wrapper.find('.van-pull-refresh__head');
|
||||
expect(head.style.height).toEqual('100px');
|
||||
});
|
||||
|
||||
test('should allow to custom pull distance', async () => {
|
||||
const wrapper = mount(PullRefresh, {
|
||||
props: {
|
||||
pullDistance: 300,
|
||||
},
|
||||
});
|
||||
const track = wrapper.find('.van-pull-refresh__track');
|
||||
|
||||
trigger(track, 'touchstart', 0, 0);
|
||||
trigger(track, 'touchmove', 0, 100);
|
||||
await later();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user