diff --git a/src/action-bar/test/index.legacy.js b/src/action-bar/test/index.legacy.js index 1db44eaeb..7964b004f 100644 --- a/src/action-bar/test/index.legacy.js +++ b/src/action-bar/test/index.legacy.js @@ -22,7 +22,7 @@ test('Button render default slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('Icon render default slot', () => { @@ -32,7 +32,7 @@ test('Icon render default slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('Icon render icon slot', () => { @@ -47,7 +47,7 @@ test('Icon render icon slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('Icon render icon slot with badge', () => { @@ -65,7 +65,7 @@ test('Icon render icon slot with badge', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('Icon render icon slot with dot', () => { @@ -83,7 +83,7 @@ test('Icon render icon slot with dot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable safe-area-inset-bottom prop', () => { @@ -93,5 +93,5 @@ test('disable safe-area-inset-bottom prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/action-sheet/test/index.legacy.js b/src/action-sheet/test/index.legacy.js index 3228ce2a9..6c2b63119 100644 --- a/src/action-sheet/test/index.legacy.js +++ b/src/action-sheet/test/index.legacy.js @@ -38,7 +38,7 @@ test('callback events', () => { expect(onCancel).toHaveBeenCalled(); expect(onInput).toHaveBeenCalledWith(false); expect(onSelect).toHaveBeenCalledWith(actions[0], 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click overlay and close', async () => { @@ -87,7 +87,7 @@ test('disable lazy-render', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render title and default slot', () => { @@ -103,7 +103,7 @@ test('render title and default slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('get container', () => { @@ -147,7 +147,7 @@ test('round prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('color option', () => { @@ -158,7 +158,7 @@ test('color option', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('description prop', () => { @@ -170,7 +170,7 @@ test('description prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('description slot', () => { @@ -184,7 +184,7 @@ test('description slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('close-icon prop', () => { @@ -196,7 +196,7 @@ test('close-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('closeable prop', () => { @@ -208,5 +208,5 @@ test('closeable prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/address-edit/test/index.legacy.js b/src/address-edit/test/index.legacy.js index 376133a9d..0052e2ebb 100644 --- a/src/address-edit/test/index.legacy.js +++ b/src/address-edit/test/index.legacy.js @@ -52,7 +52,7 @@ test('create a AddressEdit with props', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('valid area placeholder confirm', async () => { @@ -69,7 +69,7 @@ test('valid area placeholder confirm', async () => { expect(data.areaCode).toBe(''); await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('show area component', async () => { @@ -79,19 +79,19 @@ test('show area component', async () => { field.trigger('click'); await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.find('.van-picker__cancel').trigger('click'); await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('set-default', () => { const { wrapper } = createComponent(); wrapper.find('.van-switch').trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('validator props', async () => { diff --git a/src/address-list/test/index.legacy.js b/src/address-list/test/index.legacy.js index bd651cee6..8a37fb08f 100644 --- a/src/address-list/test/index.legacy.js +++ b/src/address-list/test/index.legacy.js @@ -24,7 +24,7 @@ test('unswitchable', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('select event', () => { diff --git a/src/area/test/index.legacy.js b/src/area/test/index.legacy.js index 12a4d2c7e..ec4ee113a 100644 --- a/src/area/test/index.legacy.js +++ b/src/area/test/index.legacy.js @@ -43,16 +43,16 @@ test('watch areaList & code', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setProps({ value: '110117' }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setProps({ value: '', }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('change option', () => { @@ -67,15 +67,15 @@ test('change option', () => { }); const columns = wrapper.findAll('.van-picker-column'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(columns.at(0), 0, -100); columns.at(0).find('ul').trigger('transitionend'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(columns.at(2), 0, -100); columns.at(2).find('ul').trigger('transitionend'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onChange.mock.calls[0][1]).toEqual(secondOption); }); @@ -102,9 +102,9 @@ test('reset method', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.vm.reset(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('columns-num prop', async () => { @@ -120,7 +120,7 @@ test('columns-num prop', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title slot', async () => { @@ -131,7 +131,7 @@ test('title slot', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('columns-top、columns-bottom slot', async () => { @@ -143,5 +143,5 @@ test('columns-top、columns-bottom slot', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/badge/test/index.legacy.js b/src/badge/test/index.legacy.js index 276a3c2ab..b0b7b6f79 100644 --- a/src/badge/test/index.legacy.js +++ b/src/badge/test/index.legacy.js @@ -8,7 +8,7 @@ test('should not render when badge is empty string', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should not render when badge is empty undefined', () => { @@ -18,7 +18,7 @@ test('should not render when badge is empty undefined', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should render when badge is zero', () => { @@ -28,5 +28,5 @@ test('should render when badge is zero', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/calendar/test/index.legacy.js b/src/calendar/test/index.legacy.js index 4fabe9d06..f885ba092 100644 --- a/src/calendar/test/index.legacy.js +++ b/src/calendar/test/index.legacy.js @@ -256,7 +256,7 @@ test('row-height prop', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('formatter prop', async () => { @@ -291,7 +291,7 @@ test('formatter prop', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title & footer slot', async () => { @@ -310,7 +310,7 @@ test('title & footer slot', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should reset when type changed', async () => { @@ -398,12 +398,12 @@ test('popup wrapper', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setProps({ value: true }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.find('.van-popup__close-icon').trigger('click'); expect(wrapper.element.style.display).toEqual('none'); @@ -437,7 +437,7 @@ test('color prop when type is single', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('color prop when type is range', async () => { @@ -454,7 +454,7 @@ test('color prop when type is range', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('close event', () => { diff --git a/src/calendar/test/prop.legacy.js b/src/calendar/test/prop.legacy.js index 491cc6e57..6d3f177d0 100644 --- a/src/calendar/test/prop.legacy.js +++ b/src/calendar/test/prop.legacy.js @@ -178,7 +178,7 @@ test('lazy-render prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('month-show event', async () => { diff --git a/src/card/test/index.legacy.js b/src/card/test/index.legacy.js index 4563041f1..4aaff672b 100644 --- a/src/card/test/index.legacy.js +++ b/src/card/test/index.legacy.js @@ -50,7 +50,7 @@ test('render price & num slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render origin-price slot', () => { @@ -60,7 +60,7 @@ test('render origin-price slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render bottom slot', () => { @@ -70,7 +70,7 @@ test('render bottom slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render thumb & tag slot', () => { @@ -81,7 +81,7 @@ test('render thumb & tag slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render title & desc slot', () => { @@ -92,7 +92,7 @@ test('render title & desc slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render price & price-top slot', () => { @@ -103,5 +103,5 @@ test('render price & price-top slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/cell/test/index.legacy.js b/src/cell/test/index.legacy.js index 0fd6b240d..77b6e7449 100644 --- a/src/cell/test/index.legacy.js +++ b/src/cell/test/index.legacy.js @@ -24,7 +24,7 @@ test('arrow direction', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render slot', () => { @@ -42,7 +42,7 @@ test('render slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title-style prop', () => { @@ -55,7 +55,7 @@ test('title-style prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('CellGroup title slot', () => { @@ -65,7 +65,7 @@ test('CellGroup title slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('icon-prefix prop', () => { @@ -76,5 +76,5 @@ test('icon-prefix prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/checkbox/test/index.legacy.js b/src/checkbox/test/index.legacy.js index 9d91c366a..77af1629f 100644 --- a/src/checkbox/test/index.legacy.js +++ b/src/checkbox/test/index.legacy.js @@ -40,7 +40,7 @@ test('label disabled', () => { wrapper.find('.van-checkbox__label').trigger('click'); expect(wrapper.emitted('input')).toBeFalsy(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('checkbox group', async () => { @@ -101,7 +101,7 @@ test('label-position prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('icon-size prop', () => { @@ -114,7 +114,7 @@ test('icon-size prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('checked-color prop', () => { @@ -127,7 +127,7 @@ test('checked-color prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('bind-group prop', async () => { diff --git a/src/circle/test/index.legacy.js b/src/circle/test/index.legacy.js index 5b6a1481f..a598bf044 100644 --- a/src/circle/test/index.legacy.js +++ b/src/circle/test/index.legacy.js @@ -18,7 +18,7 @@ test('speed is 0', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('animate', async () => { @@ -45,7 +45,7 @@ test('size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('stroke-linecap prop', () => { @@ -55,5 +55,5 @@ test('stroke-linecap prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/col/test/index.legacy.js b/src/col/test/index.legacy.js index dfe0a20ac..43264b042 100644 --- a/src/col/test/index.legacy.js +++ b/src/col/test/index.legacy.js @@ -44,5 +44,5 @@ test('gutter prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/collapse/test/index.legacy.js b/src/collapse/test/index.legacy.js index d6c8f1e0a..f18226ad6 100644 --- a/src/collapse/test/index.legacy.js +++ b/src/collapse/test/index.legacy.js @@ -83,7 +83,7 @@ test('render collapse-item slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable border', () => { @@ -93,7 +93,7 @@ test('disable border', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('lazy render collapse content', async () => { @@ -120,7 +120,7 @@ test('lazy render collapse content', async () => { titles.at(1).trigger('click'); wrapper.vm.content = 'content'; - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('toggle method', (done) => { diff --git a/src/count-down/test/index.legacy.js b/src/count-down/test/index.legacy.js index 53abbf532..d1cf1f7d7 100644 --- a/src/count-down/test/index.legacy.js +++ b/src/count-down/test/index.legacy.js @@ -67,7 +67,7 @@ test('disable auto-start prop', async () => { }); await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('start method', async () => { @@ -135,7 +135,7 @@ test('complete format prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('milliseconds format SS', () => { @@ -147,7 +147,7 @@ test('milliseconds format SS', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('milliseconds format S', () => { @@ -159,7 +159,7 @@ test('milliseconds format S', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('incomplate format prop', () => { @@ -171,7 +171,7 @@ test('incomplate format prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('pause when unmounted', () => { diff --git a/src/coupon-list/test/index.legacy.js b/src/coupon-list/test/index.legacy.js index a0e2053d4..5233a6f3d 100644 --- a/src/coupon-list/test/index.legacy.js +++ b/src/coupon-list/test/index.legacy.js @@ -82,7 +82,7 @@ test('render disabled coupon', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render coupon list', async () => { @@ -101,7 +101,7 @@ test('render coupon list', async () => { }, }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render empty coupon list', () => { @@ -112,7 +112,7 @@ test('render empty coupon list', () => { }, }); wrapper.findAll('.van-tab').at(1).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('empty-image prop', () => { @@ -122,7 +122,7 @@ test('empty-image prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('exchange coupon', () => { @@ -154,7 +154,7 @@ test('render coupon cell', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.trigger('click'); expect(onClick).toHaveBeenCalledTimes(1); }); @@ -166,7 +166,7 @@ test('render coupon cell with coupon', () => { chosenCoupon: 0, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render coupon cell with zero discount', () => { @@ -176,5 +176,5 @@ test('render coupon cell with zero discount', () => { chosenCoupon: 0, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/datetime-picker/test/date-picker.legacy.js b/src/datetime-picker/test/date-picker.legacy.js index 07b4148fc..c2bb31d01 100644 --- a/src/datetime-picker/test/date-picker.legacy.js +++ b/src/datetime-picker/test/date-picker.legacy.js @@ -20,7 +20,7 @@ test('filter prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('formatter prop', async () => { @@ -34,7 +34,7 @@ test('formatter prop', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(wrapper.find('.van-picker-column'), 0, -100); wrapper.find('.van-picker-column ul').trigger('transitionend'); diff --git a/src/datetime-picker/test/datetime-picker.legacy.js b/src/datetime-picker/test/datetime-picker.legacy.js index a268c45a2..6898c822f 100644 --- a/src/datetime-picker/test/datetime-picker.legacy.js +++ b/src/datetime-picker/test/datetime-picker.legacy.js @@ -28,7 +28,7 @@ test('time type', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('getPicker method', () => { diff --git a/src/datetime-picker/test/time-picker.legacy.js b/src/datetime-picker/test/time-picker.legacy.js index 989b2e00c..387eef48e 100644 --- a/src/datetime-picker/test/time-picker.legacy.js +++ b/src/datetime-picker/test/time-picker.legacy.js @@ -18,7 +18,7 @@ test('format initial value', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('max-hour & max-minute', () => { @@ -30,7 +30,7 @@ test('max-hour & max-minute', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('filter prop', () => { @@ -41,7 +41,7 @@ test('filter prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('formatter prop', async () => { @@ -53,7 +53,7 @@ test('formatter prop', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(wrapper.find('.van-picker-column'), 0, -100); wrapper.find('.van-picker-column ul').trigger('transitionend'); diff --git a/src/dialog/test/index.legacy.js b/src/dialog/test/index.legacy.js index a64bc5116..8b128bb3e 100644 --- a/src/dialog/test/index.legacy.js +++ b/src/dialog/test/index.legacy.js @@ -84,7 +84,7 @@ test('button color', () => { confirmButtonColor: 'red', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('button text', () => { @@ -96,7 +96,7 @@ test('button text', () => { confirmButtonText: 'Custom confirm', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('dialog component', () => { @@ -112,7 +112,7 @@ test('default slot', () => { default: () => 'Custom Message', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title slot', () => { @@ -124,7 +124,7 @@ test('title slot', () => { title: () => 'Custom Title', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('allow-html prop', () => { diff --git a/src/dropdown-menu/test/index.legacy.js b/src/dropdown-menu/test/index.legacy.js index b92047b4b..3235abfed 100644 --- a/src/dropdown-menu/test/index.legacy.js +++ b/src/dropdown-menu/test/index.legacy.js @@ -31,13 +31,13 @@ test('show dropdown item', async () => { const titles = wrapper.findAll('.van-dropdown-menu__title'); titles.at(0).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); titles.at(1).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); titles.at(1).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render option icon', async () => { @@ -50,7 +50,7 @@ test('render option icon', async () => { const titles = wrapper.findAll('.van-dropdown-menu__title'); titles.at(0).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('close-on-click-outside', async () => { @@ -64,7 +64,7 @@ test('close-on-click-outside', async () => { titles.at(0).trigger('click'); document.body.click(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable close-on-click-outside', async () => { @@ -78,7 +78,7 @@ test('disable close-on-click-outside', async () => { titles.at(0).trigger('click'); document.body.click(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('direction up', async () => { @@ -90,11 +90,11 @@ test('direction up', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const titles = wrapper.findAll('.van-dropdown-menu__title'); titles.at(0).trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); window.innerHeight = innerHeight; }); @@ -111,19 +111,19 @@ test('click option', async () => { options.at(1).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title prop', async () => { const wrapper = renderWrapper({ title: 'Title' }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('didn`t find matched option', async () => { const wrapper = renderWrapper({ value: -1 }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('destroy one item', async () => { @@ -148,7 +148,7 @@ test('destroy one item', async () => { await later(); wrapper.setData({ render: false }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable dropdown item', async () => { @@ -171,7 +171,7 @@ test('disable dropdown item', async () => { const title = wrapper.find('.van-dropdown-menu__title'); title.trigger('click'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('change event', async () => { @@ -251,5 +251,5 @@ test('title slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/empty/test/index.legacy.js b/src/empty/test/index.legacy.js index 5c9e81a0b..692a1c69a 100644 --- a/src/empty/test/index.legacy.js +++ b/src/empty/test/index.legacy.js @@ -8,7 +8,7 @@ test('image slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('description slot', () => { @@ -18,7 +18,7 @@ test('description slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('bottom slot', () => { @@ -28,7 +28,7 @@ test('bottom slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render svg when image is network', () => { @@ -38,7 +38,7 @@ test('render svg when image is network', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('image-size prop', () => { diff --git a/src/field/test/index.legacy.js b/src/field/test/index.legacy.js index e0a145001..a4f9c6b87 100644 --- a/src/field/test/index.legacy.js +++ b/src/field/test/index.legacy.js @@ -106,7 +106,7 @@ test('render textarea', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('autosize textarea field', () => { @@ -200,10 +200,10 @@ test('clearable prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const input = wrapper.find('input'); input.trigger('focus'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.find('.van-field__clear').trigger('touchstart'); expect(wrapper.emitted('input')[0][0]).toEqual(''); @@ -229,7 +229,7 @@ test('render input slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render label slot', () => { @@ -239,7 +239,7 @@ test('render label slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render extra slot', () => { @@ -249,7 +249,7 @@ test('render extra slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('size prop', () => { @@ -258,7 +258,7 @@ test('size prop', () => { size: 'large', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('label-width prop with unit', () => { @@ -268,7 +268,7 @@ test('label-width prop with unit', () => { labelWidth: '10rem', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('label-width prop without unit', () => { @@ -278,7 +278,7 @@ test('label-width prop without unit', () => { labelWidth: 100, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('label-class prop', () => { @@ -288,7 +288,7 @@ test('label-class prop', () => { labelClass: 'custom-label-class', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('arrow-direction prop', () => { @@ -298,7 +298,7 @@ test('arrow-direction prop', () => { arrowDirection: 'up', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('formatter prop', () => { @@ -348,7 +348,7 @@ test('reach max word-limit', () => { showWordLimit: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('reach max word-limit undefined', () => { @@ -359,7 +359,7 @@ test('reach max word-limit undefined', () => { showWordLimit: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('reach max word-limit null', () => { @@ -370,7 +370,7 @@ test('reach max word-limit null', () => { showWordLimit: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('name prop', () => { @@ -379,7 +379,7 @@ test('name prop', () => { name: 'foo', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('call focus method before mounted', (done) => { @@ -403,7 +403,7 @@ test('colon prop', () => { colon: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should blur search input on enter', () => { diff --git a/src/form/test/events.legacy.js b/src/form/test/events.legacy.js index a97beb100..e9af2642a 100644 --- a/src/form/test/events.legacy.js +++ b/src/form/test/events.legacy.js @@ -29,7 +29,7 @@ test('failed event', async () => { await submitForm(wrapper); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onFailed).toHaveBeenCalledWith({ errors: [ { name: 'A', message: 'A failed' }, diff --git a/src/form/test/props.legacy.js b/src/form/test/props.legacy.js index c12959d1a..73452afb2 100644 --- a/src/form/test/props.legacy.js +++ b/src/form/test/props.legacy.js @@ -188,7 +188,7 @@ test('validate-first prop', async () => { await submitForm(wrapper); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onFailed).toHaveBeenCalledWith({ errors: [{ message: 'A failed', name: 'A' }], values: { A: '', B: '' }, @@ -211,7 +211,7 @@ test('colon prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('label-align prop', () => { @@ -223,7 +223,7 @@ test('label-align prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('label-width prop', () => { @@ -235,7 +235,7 @@ test('label-width prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('input-align prop', () => { @@ -251,7 +251,7 @@ test('input-align prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('error-message-align prop', () => { @@ -262,7 +262,7 @@ test('error-message-align prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('validate-trigger - onBlur', async () => { diff --git a/src/grid/test/index.legacy.js b/src/grid/test/index.legacy.js index 78f15a3ed..68775845c 100644 --- a/src/grid/test/index.legacy.js +++ b/src/grid/test/index.legacy.js @@ -30,7 +30,7 @@ test('sqaure and set gutter', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('icon-size prop', () => { @@ -42,7 +42,7 @@ test('icon-size prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render icon-slot', () => { @@ -58,5 +58,5 @@ test('render icon-slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/icon/test/index.legacy.js b/src/icon/test/index.legacy.js index 60062101f..d49d1e275 100644 --- a/src/icon/test/index.legacy.js +++ b/src/icon/test/index.legacy.js @@ -7,7 +7,7 @@ test('render icon with builtin icon name', () => { name: 'success', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render icon with url name', () => { @@ -16,7 +16,7 @@ test('render icon with url name', () => { name: 'https://img.yzcdn.com/icon.jpg', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render icon with local image', () => { @@ -25,7 +25,7 @@ test('render icon with local image', () => { name: '/assets/icon.jpg', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render icon default slot', () => { @@ -34,7 +34,7 @@ test('render icon default slot', () => { return h(Icon, { props: { name: 'success' } }, ['Default slot']); }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('tag prop', () => { @@ -43,7 +43,7 @@ test('tag prop', () => { tag: 'div', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('dot prop', () => { @@ -52,7 +52,7 @@ test('dot prop', () => { dot: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('size without unit', () => { @@ -61,5 +61,5 @@ test('size without unit', () => { size: 20, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/image-preview/test/index.legacy.js b/src/image-preview/test/index.legacy.js index 95d2752dc..12103af34 100644 --- a/src/image-preview/test/index.legacy.js +++ b/src/image-preview/test/index.legacy.js @@ -42,7 +42,7 @@ test('render image', async () => { propsData: { images, value: true }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); await later(); @@ -78,7 +78,7 @@ test('close-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('close-icon-position prop', () => { @@ -91,7 +91,7 @@ test('close-icon-position prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('async close prop', async () => { @@ -274,7 +274,7 @@ test('set show-index prop to false', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('index slot', () => { @@ -286,7 +286,7 @@ test('index slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('cover slot', () => { @@ -298,7 +298,7 @@ test('cover slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('closeOnPopstate', () => { diff --git a/src/image/test/index.legacy.js b/src/image/test/index.legacy.js index 6599841d0..163b4bd0f 100644 --- a/src/image/test/index.legacy.js +++ b/src/image/test/index.legacy.js @@ -19,10 +19,10 @@ test('load event', () => { wrapper.find('img').trigger('load'); expect(wrapper.emitted('load')[0][0]).toBeTruthy(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setProps({ src: '' }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('error event', () => { @@ -45,7 +45,7 @@ test('lazy load', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('lazy-load load event', (done) => { @@ -62,7 +62,7 @@ test('lazy-load load event', (done) => { hanlder({ el: null }); hanlder({ el: wrapper.find('img').element }); expect(wrapper.emitted('load').length).toEqual(1); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.destroy(); }); } @@ -88,7 +88,7 @@ test('lazy-load error event', (done) => { hanlder({ el: null }); hanlder({ el: wrapper.find('img').element }); expect(wrapper.emitted('error').length).toEqual(1); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.destroy(); }); } @@ -108,7 +108,7 @@ test('show-loading prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('show-error prop', () => { @@ -121,7 +121,7 @@ test('show-error prop', () => { wrapper.find('img').trigger('error'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('error-icon prop', () => { @@ -134,7 +134,7 @@ test('error-icon prop', () => { wrapper.find('img').trigger('error'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('loading-icon prop', () => { @@ -144,7 +144,7 @@ test('loading-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('apply icon-prefix prop to error-icon', () => { @@ -158,7 +158,7 @@ test('apply icon-prefix prop to error-icon', () => { wrapper.find('img').trigger('error'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('apply icon-prefix prop to loading-icon', () => { @@ -169,7 +169,7 @@ test('apply icon-prefix prop to loading-icon', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('radius prop', () => { @@ -180,7 +180,7 @@ test('radius prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('default slot', () => { @@ -193,5 +193,5 @@ test('default slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/index-bar/test/index.legacy.js b/src/index-bar/test/index.legacy.js index 65390e9fb..37a3a6c62 100644 --- a/src/index-bar/test/index.legacy.js +++ b/src/index-bar/test/index.legacy.js @@ -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; diff --git a/src/list/test/index.legacy.js b/src/list/test/index.legacy.js index 630d865fc..df55978dc 100644 --- a/src/list/test/index.legacy.js +++ b/src/list/test/index.legacy.js @@ -80,7 +80,7 @@ test('finished slot', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('error slot', async () => { @@ -93,7 +93,7 @@ test('error slot', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('immediate check false', async () => { diff --git a/src/loading/test/index.legacy.js b/src/loading/test/index.legacy.js index 5459775a1..370061ba2 100644 --- a/src/loading/test/index.legacy.js +++ b/src/loading/test/index.legacy.js @@ -8,7 +8,7 @@ test('size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('text-size prop', () => { @@ -21,5 +21,5 @@ test('text-size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/nav-bar/test/index.legacy.js b/src/nav-bar/test/index.legacy.js index 98f134ee9..0bacc7f91 100644 --- a/src/nav-bar/test/index.legacy.js +++ b/src/nav-bar/test/index.legacy.js @@ -9,7 +9,7 @@ test('should render left/right slot and match snapshot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should render title slot and match snapshot', () => { @@ -19,7 +19,7 @@ test('should render title slot and match snapshot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should render placeholder element when using placeholder prop', () => { @@ -32,7 +32,7 @@ test('should render placeholder element when using placeholder prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restore(); }); diff --git a/src/notice-bar/test/index.legacy.js b/src/notice-bar/test/index.legacy.js index 45df3c8dd..318c23ecb 100644 --- a/src/notice-bar/test/index.legacy.js +++ b/src/notice-bar/test/index.legacy.js @@ -34,7 +34,7 @@ test('icon slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('replay event', async () => { @@ -69,7 +69,7 @@ test('should scroll when content width > wrap width ', async () => { await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should not scroll when content width > wrap width ', async () => { @@ -92,5 +92,5 @@ test('should not scroll when content width > wrap width ', async () => { await later(50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/number-keyboard/test/index.legacy.js b/src/number-keyboard/test/index.legacy.js index 39990660e..e2eba7c63 100644 --- a/src/number-keyboard/test/index.legacy.js +++ b/src/number-keyboard/test/index.legacy.js @@ -80,7 +80,7 @@ test('render title', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('title-left slot', () => { @@ -90,7 +90,7 @@ test('title-left slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('extra-key prop', () => { @@ -100,7 +100,7 @@ test('extra-key prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('extra-key slot', () => { @@ -110,7 +110,7 @@ test('extra-key slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('hideOnClickOutside', () => { @@ -141,9 +141,9 @@ test('focus on key', () => { const key = wrapper.find('.van-key'); trigger(key, 'touchstart'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); trigger(key, 'touchend'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('move and blur key', () => { @@ -151,11 +151,11 @@ test('move and blur key', () => { const key = wrapper.find('.van-key'); trigger(key, 'touchstart'); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); trigger(key, 'touchmove', 0, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); trigger(key, 'touchmove', 100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); trigger(key, 'touchend'); expect(wrapper.emitted('input')).toBeFalsy(); }); diff --git a/src/overlay/test/index.legacy.js b/src/overlay/test/index.legacy.js index 093aa569c..23946dda3 100644 --- a/src/overlay/test/index.legacy.js +++ b/src/overlay/test/index.legacy.js @@ -9,7 +9,7 @@ test('z-index prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('class-name prop', () => { @@ -20,7 +20,7 @@ test('class-name prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('custom style prop', () => { @@ -33,7 +33,7 @@ test('custom style prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('duration prop', () => { @@ -44,7 +44,7 @@ test('duration prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click event', () => { @@ -68,7 +68,7 @@ test('default slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('lock-scroll prop', () => { diff --git a/src/pagination/test/index.legacy.js b/src/pagination/test/index.legacy.js index e4915ac20..690263c55 100644 --- a/src/pagination/test/index.legacy.js +++ b/src/pagination/test/index.legacy.js @@ -13,7 +13,7 @@ test('render prev-text & next-text slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render page slot', () => { @@ -27,5 +27,5 @@ test('render page slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/picker/test/cascade.legacy.js b/src/picker/test/cascade.legacy.js index 90d599878..f7c6b7ea6 100644 --- a/src/picker/test/cascade.legacy.js +++ b/src/picker/test/cascade.legacy.js @@ -143,7 +143,7 @@ test('should move to next option when default option is disabled', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should move to first option when all options are disabled', () => { @@ -170,5 +170,5 @@ test('should move to first option when all options are disabled', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/picker/test/index.legacy.js b/src/picker/test/index.legacy.js index c13aab4d2..f42e899a2 100644 --- a/src/picker/test/index.legacy.js +++ b/src/picker/test/index.legacy.js @@ -129,10 +129,10 @@ test('column watch default index', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.vm.defaultIndex = 2; - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render title slot', () => { @@ -144,7 +144,7 @@ test('render title slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render confirm/cancel slot', () => { @@ -157,7 +157,7 @@ test('render confirm/cancel slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render option slot with simple columns', () => { @@ -172,7 +172,7 @@ test('render option slot with simple columns', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render option slot with object columns', () => { @@ -189,7 +189,7 @@ test('render option slot with object columns', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('simulation finger swipe again before transitionend', () => { @@ -242,7 +242,7 @@ test('toolbar-position prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('not allow html', () => { @@ -253,7 +253,7 @@ test('not allow html', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('columns-top、columns-bottom prop', () => { @@ -267,7 +267,7 @@ test('columns-top、columns-bottom prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('watch columns change', () => { @@ -317,7 +317,7 @@ test('set rem item-height', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); window.getComputedStyle = originGetComputedStyle; }); diff --git a/src/popup/test/index.legacy.js b/src/popup/test/index.legacy.js index 2aa3d27e5..43fecea8c 100644 --- a/src/popup/test/index.legacy.js +++ b/src/popup/test/index.legacy.js @@ -22,7 +22,7 @@ test('reset z-index', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('popup lock scroll', () => { @@ -214,7 +214,7 @@ test('duration prop when position is center', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('duration prop when position is top', () => { @@ -226,7 +226,7 @@ test('duration prop when position is top', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('round prop', () => { @@ -237,7 +237,7 @@ test('round prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('closeable prop', () => { @@ -261,5 +261,5 @@ test('close-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/progress/test/index.legacy.js b/src/progress/test/index.legacy.js index 252abf346..8d74097ab 100644 --- a/src/progress/test/index.legacy.js +++ b/src/progress/test/index.legacy.js @@ -9,12 +9,12 @@ test('calc width', async () => { }, }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.vm.showPivot = true; wrapper.vm.pivotText = 'test'; await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('track color prop', async () => { diff --git a/src/pull-refresh/test/index.legacy.js b/src/pull-refresh/test/index.legacy.js index 25591e727..664d011a0 100644 --- a/src/pull-refresh/test/index.legacy.js +++ b/src/pull-refresh/test/index.legacy.js @@ -18,19 +18,19 @@ test('change head content when pulling down', async () => { // pulling trigger(track, 'touchstart', 0, 0); trigger(track, 'touchmove', 0, 20); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // loosing trigger(track, 'touchmove', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // loading trigger(track, 'touchend', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // still loading triggerDrag(track, 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.emitted('input')).toBeTruthy(); expect(wrapper.emitted('refresh')).toBeFalsy(); @@ -40,7 +40,7 @@ test('change head content when pulling down', async () => { // end loading wrapper.vm.value = false; - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('custom content by slots', async () => { @@ -63,16 +63,16 @@ test('custom content by slots', async () => { // pulling trigger(track, 'touchstart', 0, 0); trigger(track, 'touchmove', 0, 20); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // loosing trigger(track, 'touchmove', 0, 75); trigger(track, 'touchmove', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // loading trigger(track, 'touchend', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('pull a short distance', () => { @@ -102,7 +102,7 @@ test('not in page top', () => { window.scrollTop = 0; trigger(track, 'touchmove', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render success text', async () => { @@ -128,11 +128,11 @@ test('render success text', async () => { wrapper.setProps({ value: false }); // success - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // normal await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render success slot', async () => { @@ -154,7 +154,7 @@ test('render success slot', async () => { expect(wrapper.vm.value).toBeTruthy(); wrapper.setProps({ value: false }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should set height when using head-height', async () => { @@ -164,5 +164,5 @@ test('should set height when using head-height', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/radio/test/index.legacy.js b/src/radio/test/index.legacy.js index 0174cc846..a84a83e50 100644 --- a/src/radio/test/index.legacy.js +++ b/src/radio/test/index.legacy.js @@ -75,7 +75,7 @@ test('icon-size prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('checked-color prop', () => { @@ -88,5 +88,5 @@ test('checked-color prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/rate/test/index.legacy.js b/src/rate/test/index.legacy.js index 3e2bd51fe..24bae2509 100644 --- a/src/rate/test/index.legacy.js +++ b/src/rate/test/index.legacy.js @@ -125,7 +125,7 @@ test('gutter prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('size prop', () => { @@ -135,7 +135,7 @@ test('size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('untouchable', () => { diff --git a/src/search/test/index.legacy.js b/src/search/test/index.legacy.js index 8a01cd189..f709dd2fc 100644 --- a/src/search/test/index.legacy.js +++ b/src/search/test/index.legacy.js @@ -70,7 +70,7 @@ test('label slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('left slot', () => { @@ -80,7 +80,7 @@ test('left slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('left-icon prop', () => { @@ -90,7 +90,7 @@ test('left-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('right-icon prop', () => { @@ -100,7 +100,7 @@ test('right-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('right-icon slot', () => { @@ -110,7 +110,7 @@ test('right-icon slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('action-text prop', () => { @@ -121,5 +121,5 @@ test('action-text prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/share-sheet/test/index.legacy.js b/src/share-sheet/test/index.legacy.js index f8a1e437a..ef44dabe0 100644 --- a/src/share-sheet/test/index.legacy.js +++ b/src/share-sheet/test/index.legacy.js @@ -81,7 +81,7 @@ test('title & description slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click-overlay event', async () => { diff --git a/src/sidebar/test/index.legacy.js b/src/sidebar/test/index.legacy.js index 966eb72d0..977c50c08 100644 --- a/src/sidebar/test/index.legacy.js +++ b/src/sidebar/test/index.legacy.js @@ -93,5 +93,5 @@ test('title slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/skeleton/test/index.legacy.js b/src/skeleton/test/index.legacy.js index d46140c9d..9a8f31967 100644 --- a/src/skeleton/test/index.legacy.js +++ b/src/skeleton/test/index.legacy.js @@ -8,7 +8,7 @@ test('row-width array', () => { rowWidth: ['100%', 30, '5rem'], }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render chidren', () => { @@ -20,7 +20,7 @@ test('render chidren', () => { `, components: { Skeleton }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('avatar shape', () => { @@ -31,7 +31,7 @@ test('avatar shape', () => { avatarShape: 'square', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('round prop', () => { @@ -42,7 +42,7 @@ test('round prop', () => { avatar: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable animate', () => { @@ -52,5 +52,5 @@ test('disable animate', () => { aniamte: false, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/slider/test/index.legacy.js b/src/slider/test/index.legacy.js index 53333b201..a0c2b9c71 100644 --- a/src/slider/test/index.legacy.js +++ b/src/slider/test/index.legacy.js @@ -31,7 +31,7 @@ test('drag button', () => { const button = wrapper.find('.van-slider__button'); triggerDrag(button, 50, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.emitted('drag-start')).toBeFalsy(); expect(wrapper.emitted('drag-end')).toBeFalsy(); @@ -39,7 +39,7 @@ test('drag button', () => { trigger(button, 'touchstart', 0, 0); trigger(button, 'touchend', 0, 0); triggerDrag(button, 50, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.emitted('drag-start')).toBeTruthy(); expect(wrapper.emitted('drag-end')).toBeTruthy(); @@ -61,11 +61,11 @@ test('click bar', () => { }); trigger(wrapper, 'click', 100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setData({ disabled: false }); trigger(wrapper, 'click', 100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restoreMock(); }); @@ -86,7 +86,7 @@ test('drag button vertical', () => { const button = wrapper.find('.van-slider__button'); triggerDrag(button, 0, 50); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restoreMock(); }); @@ -106,7 +106,7 @@ test('click vertical', () => { }); trigger(wrapper, 'click', 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restoreMock(); }); @@ -119,7 +119,7 @@ test('bar-height prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('button-size prop', () => { @@ -130,7 +130,7 @@ test('button-size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('should not emit change event when value not changed', () => { diff --git a/src/stepper/test/index.legacy.js b/src/stepper/test/index.legacy.js index bb1072689..50080d23d 100644 --- a/src/stepper/test/index.legacy.js +++ b/src/stepper/test/index.legacy.js @@ -7,7 +7,7 @@ test('disabled stepper', () => { disabled: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable stepper input', () => { @@ -16,7 +16,7 @@ test('disable stepper input', () => { disableInput: true, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable button', async () => { @@ -216,7 +216,7 @@ test('input-width prop', () => { inputWidth: '10rem', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('button-size prop', () => { @@ -225,7 +225,7 @@ test('button-size prop', () => { buttonSize: '2rem', }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('async-change prop', () => { @@ -274,7 +274,7 @@ test('show-plus & show-minus props', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('decimal-length prop', () => { diff --git a/src/steps/test/index.legacy.js b/src/steps/test/index.legacy.js index 29d694e04..8a8b818ab 100644 --- a/src/steps/test/index.legacy.js +++ b/src/steps/test/index.legacy.js @@ -19,7 +19,7 @@ test('icon slot', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click-step event', () => { @@ -57,5 +57,5 @@ test('inactive-color prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/sticky/test/index.legacy.js b/src/sticky/test/index.legacy.js index 16c6b2c2f..319f2784c 100644 --- a/src/sticky/test/index.legacy.js +++ b/src/sticky/test/index.legacy.js @@ -9,9 +9,9 @@ test('sticky to top', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); }); @@ -25,7 +25,7 @@ test('z-index prop', () => { }); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); }); @@ -39,7 +39,7 @@ test('offset-top prop', () => { }); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); }); @@ -57,7 +57,7 @@ test('offset-top with rem unit', () => { }); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); window.getComputedStyle = originGetComputedStyle; @@ -75,7 +75,7 @@ test('offset-top with vw unit', () => { }); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); }); @@ -115,9 +115,9 @@ test('container prop', () => { }); mockScrollTop(15); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(25); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); mockScrollTop(0); }); diff --git a/src/submit-bar/test/index.legacy.js b/src/submit-bar/test/index.legacy.js index ce81f1744..418993717 100644 --- a/src/submit-bar/test/index.legacy.js +++ b/src/submit-bar/test/index.legacy.js @@ -29,7 +29,7 @@ test('disable submit', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); // disabled const button = wrapper.find('.van-button'); @@ -46,7 +46,7 @@ test('without price', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('top slot', () => { @@ -56,7 +56,7 @@ test('top slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('decimal-length prop', () => { @@ -69,7 +69,7 @@ test('decimal-length prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('suffix-label prop', () => { @@ -83,7 +83,7 @@ test('suffix-label prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('text-align prop', () => { @@ -95,7 +95,7 @@ test('text-align prop', () => { }, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable safe-area-inset-bottom prop', () => { @@ -106,7 +106,7 @@ test('disable safe-area-inset-bottom prop', () => { }, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('button-color prop', () => { @@ -117,7 +117,7 @@ test('button-color prop', () => { }, }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('button slot', () => { @@ -128,5 +128,5 @@ test('button slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/swipe-cell/test/index.legacy.js b/src/swipe-cell/test/index.legacy.js index ebc3f8c3f..cab18db48 100644 --- a/src/swipe-cell/test/index.legacy.js +++ b/src/swipe-cell/test/index.legacy.js @@ -22,23 +22,23 @@ test('drag and show left part', () => { const wrapper = mount(SwipeCell, defaultProps); triggerDrag(wrapper, 10, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(wrapper, 50, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(wrapper, 500, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(wrapper, 0, 100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('drag and show right part', () => { const wrapper = mount(SwipeCell, defaultProps); triggerDrag(wrapper, -50, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('before-close prop', () => { @@ -125,7 +125,7 @@ test('auto calc width', async () => { await later(); triggerDrag(wrapper, 100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restoreMock(); }); @@ -143,7 +143,7 @@ test('render one side', async () => { await later(); triggerDrag(wrapper, 100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restoreMock(); }); diff --git a/src/switch/test/index.legacy.js b/src/switch/test/index.legacy.js index 07a177272..04076f8af 100644 --- a/src/switch/test/index.legacy.js +++ b/src/switch/test/index.legacy.js @@ -64,7 +64,7 @@ test('inactive-color prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('size prop', () => { @@ -74,7 +74,7 @@ test('size prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click event', () => { diff --git a/src/tab/test/index.legacy.js b/src/tab/test/index.legacy.js index df69e2d2e..bc4c0e5a2 100644 --- a/src/tab/test/index.legacy.js +++ b/src/tab/test/index.legacy.js @@ -47,13 +47,13 @@ test('click to switch tab', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const tabs = wrapper.findAll('.van-tab'); tabs.at(1).trigger('click'); tabs.at(2).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onChange).toHaveBeenCalledTimes(1); }); @@ -79,16 +79,16 @@ test('swipe to switch tab', async () => { const content = wrapper.find('.van-tabs__content'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); triggerDrag(content, -100, 0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onChange).toHaveBeenCalledTimes(1); expect(onChange).toHaveBeenCalledWith(1, 'title2'); triggerDrag(content, -100, 0); expect(onChange).toHaveBeenCalledTimes(1); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); await later(); wrapper.destroy(); @@ -99,7 +99,7 @@ test('change tabs data', async () => { await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setData({ swipeable: false, @@ -109,20 +109,20 @@ test('change tabs data', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('lazy render', async () => { const wrapper = createWrapper(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); wrapper.setData({ lazyRender: false, }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render nav-left & nav-right slot', async () => { @@ -133,7 +133,7 @@ test('render nav-left & nav-right slot', async () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('border props', async () => { @@ -143,7 +143,7 @@ test('border props', async () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click event', async () => { @@ -198,7 +198,7 @@ test('name prop', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const tabs = wrapper.findAll('.van-tab'); tabs.at(1).trigger('click'); @@ -253,7 +253,7 @@ test('dot prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('badge prop', () => { @@ -265,7 +265,7 @@ test('badge prop', () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('scrollspy prop', async () => { @@ -286,7 +286,7 @@ test('scrollspy prop', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const tabs = wrapper.findAll('.van-tab'); tabs.at(2).trigger('click'); @@ -294,7 +294,7 @@ test('scrollspy prop', async () => { await later(); mockScrollTop(100); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onChange).toHaveBeenCalledWith('c', 'title3'); }); @@ -431,5 +431,5 @@ test('render empty tab', async () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/tab/test/insert.legacy.js b/src/tab/test/insert.legacy.js index 3bf617316..9ac0e07e3 100644 --- a/src/tab/test/insert.legacy.js +++ b/src/tab/test/insert.legacy.js @@ -23,7 +23,7 @@ test('insert tab dynamically', async () => { await later(); wrapper.setData({ insert: true }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('insert tab with name dynamically', async () => { @@ -48,7 +48,7 @@ test('insert tab with name dynamically', async () => { await later(); wrapper.setData({ insert: true }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(onChange).toHaveBeenCalledTimes(0); }); @@ -71,5 +71,5 @@ test('insert tab with child component', async () => { }); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); diff --git a/src/tabbar/test/index.legacy.js b/src/tabbar/test/index.legacy.js index 0200eb062..6c015745a 100644 --- a/src/tabbar/test/index.legacy.js +++ b/src/tabbar/test/index.legacy.js @@ -27,18 +27,18 @@ test('route mode', async () => { `, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); const items = wrapper.findAll('.van-tabbar-item'); items.at(1).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); items.at(2).trigger('click'); items.at(3).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('route mode match by name', async () => { @@ -68,11 +68,11 @@ test('route mode match by name', async () => { const items = wrapper.findAll('.van-tabbar-item'); items.at(0).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); items.at(1).trigger('click'); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('router NavigationDuplicated', async (done) => { @@ -114,7 +114,7 @@ test('watch tabbar value', () => { }); wrapper.setData({ value: 1 }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('click event', () => { @@ -169,7 +169,7 @@ test('disable border', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('placeholder prop', () => { @@ -182,7 +182,7 @@ test('placeholder prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); restore(); }); diff --git a/src/tree-select/test/index.legacy.js b/src/tree-select/test/index.legacy.js index 428a6d03b..e97eda25d 100644 --- a/src/tree-select/test/index.legacy.js +++ b/src/tree-select/test/index.legacy.js @@ -132,7 +132,7 @@ test('content slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('height prop', () => { @@ -142,7 +142,7 @@ test('height prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('nav render badge', () => { @@ -157,7 +157,7 @@ test('nav render badge', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('use sync modifier in main-active-index', () => { diff --git a/src/uploader/test/index.legacy.js b/src/uploader/test/index.legacy.js index d9ae2f77d..eaafce47e 100644 --- a/src/uploader/test/index.legacy.js +++ b/src/uploader/test/index.legacy.js @@ -196,7 +196,7 @@ test('render upload-text', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('render preview image', async () => { @@ -218,7 +218,7 @@ test('render preview image', async () => { wrapper.vm.onChange(file); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('image-fit prop', () => { @@ -229,7 +229,7 @@ test('image-fit prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('upload-icon prop', () => { @@ -239,7 +239,7 @@ test('upload-icon prop', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('disable preview image', async () => { @@ -258,7 +258,7 @@ test('disable preview image', async () => { wrapper.vm.onChange(file); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('max-count prop', async () => { @@ -277,7 +277,7 @@ test('max-count prop', async () => { wrapper.vm.onChange(multiFile); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('preview-size prop', async () => { @@ -296,7 +296,7 @@ test('preview-size prop', async () => { wrapper.vm.onChange(file); await later(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); }); test('deletable prop', () => { @@ -328,7 +328,7 @@ test('delete preview image', () => { wrapper.find('.van-uploader__preview-delete').trigger('click'); expect(wrapper.vm.fileList.length).toEqual(0); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.emitted('delete')[0]).toBeTruthy(); }); @@ -490,7 +490,7 @@ test('file message should be reactive', (done) => { file.message = 1; setTimeout(() => { file.message = 2; - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); done(); }); }, @@ -535,5 +535,5 @@ test('preview-cover slot', () => { }, }); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.html()).toMatchSnapshot(); });