Merge branch '2.x' into dev
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
import { mount, trigger, triggerDrag, mockScrollIntoView } from '../../../test';
|
||||
|
||||
function mockOffsetHeight(offsetHeight) {
|
||||
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {
|
||||
get() {
|
||||
return offsetHeight;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
test('should allow to custom anchor text', () => {
|
||||
const wrapper = mount({
|
||||
template: `
|
||||
@@ -97,11 +89,10 @@ test('should update active anchor after page scroll', () => {
|
||||
const { index } = this.dataset;
|
||||
return {
|
||||
top: index ? index * 10 : 0,
|
||||
height: 10,
|
||||
};
|
||||
};
|
||||
|
||||
mockOffsetHeight(10);
|
||||
|
||||
const wrapper = mount({
|
||||
template: `
|
||||
<van-index-bar :sticky="sticky">
|
||||
@@ -138,11 +129,10 @@ test('should emit change event when active index changed', () => {
|
||||
const { index } = this.dataset;
|
||||
return {
|
||||
top: index ? index * 10 : 0,
|
||||
height: 10,
|
||||
};
|
||||
};
|
||||
|
||||
mockOffsetHeight(10);
|
||||
|
||||
const onChange = jest.fn();
|
||||
|
||||
mount({
|
||||
|
||||
Reference in New Issue
Block a user