test: fix wrapper snapshot usage

This commit is contained in:
chenjiahan
2020-11-08 20:03:39 +08:00
parent 95f02cd6e2
commit fffb9b3d5d
60 changed files with 318 additions and 318 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ test('should allow to custom anchor text', () => {
`,
});
expect(wrapper).toMatchSnapshot();
expect(wrapper.html()).toMatchSnapshot();
});
test('should scroll to anchor and emit select event after clicking the index-bar', () => {
@@ -122,11 +122,11 @@ test('should update active anchor after page scroll', () => {
window.scrollTop = 0;
trigger(window, 'scroll');
expect(wrapper).toMatchSnapshot();
expect(wrapper.html()).toMatchSnapshot();
wrapper.setData({ sticky: true });
trigger(window, 'scroll');
expect(wrapper).toMatchSnapshot();
expect(wrapper.html()).toMatchSnapshot();
wrapper.vm.$destroy();
Element.prototype.getBoundingClientRect = nativeRect;