diff --git a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-field/swag-migration-error-resolution-field-relation.spec.js b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-field/swag-migration-error-resolution-field-relation.spec.js index 9c4d553a5..2a1ed89c2 100644 --- a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-field/swag-migration-error-resolution-field-relation.spec.js +++ b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-field/swag-migration-error-resolution-field-relation.spec.js @@ -1,7 +1,7 @@ /** * @sw-package after-sales */ -import { mount } from '@vue/test-utils'; +import { DOMWrapper, mount } from '@vue/test-utils'; import SwagMigrationErrorResolutionFieldRelation from 'SwagMigrationAssistant/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-field/swag-migration-error-resolution-field-relation'; import SwagMigrationErrorResolutionService from 'SwagMigrationAssistant/module/swag-migration/service/swag-migration-error-resolution.service'; @@ -135,10 +135,12 @@ describe('src/module/swag-migration/component/swag-migration-error-resolution/sw await wrapper.find('.sw-migration-error-resolution-field__to-one input').trigger('click'); await flushPromises(); - expect(wrapper.find('.sw-select-result-list__content').exists()).toBe(true); + expect(new DOMWrapper(document.body).find('.sw-select-result-list__content').exists()).toBe(true); - const labels = wrapper.findAll('.swag-migration-error-resolution-field-relation__item-label'); - const ids = wrapper.findAll('.swag-migration-error-resolution-field-relation__item-id'); + const labels = new DOMWrapper(document.body).findAll( + '.swag-migration-error-resolution-field-relation__item-label', + ); + const ids = new DOMWrapper(document.body).findAll('.swag-migration-error-resolution-field-relation__item-id'); expect(labels[0].text()).toBe('result 1'); expect(ids[0].text()).toBe('1'); @@ -214,10 +216,12 @@ describe('src/module/swag-migration/component/swag-migration-error-resolution/sw await wrapper.find('.sw-migration-error-resolution-field__to_many input').trigger('click'); await flushPromises(); - expect(wrapper.find('.sw-select-result-list__content').exists()).toBe(true); + expect(new DOMWrapper(document.body).find('.sw-select-result-list__content').exists()).toBe(true); - const labels = wrapper.findAll('.swag-migration-error-resolution-field-relation__item-label'); - const ids = wrapper.findAll('.swag-migration-error-resolution-field-relation__item-id'); + const labels = new DOMWrapper(document.body).findAll( + '.swag-migration-error-resolution-field-relation__item-label', + ); + const ids = new DOMWrapper(document.body).findAll('.swag-migration-error-resolution-field-relation__item-id'); expect(labels[0].text()).toBe('result 1'); expect(ids[0].text()).toBe('1'); diff --git a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-modal.spec.js b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-modal.spec.js index 943167d42..ab7419167 100644 --- a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-modal.spec.js +++ b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-modal.spec.js @@ -1,7 +1,7 @@ /** * @sw-package after-sales */ -import { mount } from '@vue/test-utils'; +import { DOMWrapper, mount } from '@vue/test-utils'; import SwagMigrationErrorResolutionModal, { ERROR_CODE_COMPONENT_MAPPING, } from 'SwagMigrationAssistant/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-modal'; @@ -442,8 +442,10 @@ describe('module/swag-migration/component/swag-migration-error-resolution/swag-m expect(wrapper.find('.swag-migration-error-resolution-details-modal').exists()).toBe(false); - expect(wrapper.find('.sw-context-button__menu-popover').exists()).toBe(true); - await wrapper.find('.swag-migration-error-resolution-modal__left-modal-action-details').trigger('click'); + expect(new DOMWrapper(document.body).find('.sw-context-button__menu-popover').exists()).toBe(true); + await new DOMWrapper(document.body) + .find('.swag-migration-error-resolution-modal__left-modal-action-details') + .trigger('click'); expect(wrapper.find('.swag-migration-error-resolution-details-modal').exists()).toBe(true); expect(wrapper.vm.selectedDetailsLog).toStrictEqual(wrapper.vm.tableData.at(0)); @@ -471,15 +473,21 @@ describe('module/swag-migration/component/swag-migration-error-resolution/swag-m await wrapper.find('.sw-data-grid__row--1 .sw-data-grid__cell--actions button').trigger('click'); await flushPromises(); - expect(wrapper.find('.swag-migration-error-resolution-modal__left-modal-action-reset').exists()).toBe(false); + expect( + new DOMWrapper(document.body) + .find('.swag-migration-error-resolution-modal__left-modal-action-reset') + .exists(), + ).toBe(false); await wrapper.find('.sw-data-grid__row--0 .sw-data-grid__cell--actions button').trigger('click'); await flushPromises(); migrationFixRepositoryMock.search.mockReturnValueOnce(Promise.resolve([])); - expect(wrapper.find('.sw-context-button__menu-popover').exists()).toBe(true); - await wrapper.find('.swag-migration-error-resolution-modal__left-modal-action-reset').trigger('click'); + expect(new DOMWrapper(document.body).find('.sw-context-button__menu-popover').exists()).toBe(true); + await new DOMWrapper(document.body) + .find('.swag-migration-error-resolution-modal__left-modal-action-reset') + .trigger('click'); await flushPromises(); @@ -888,7 +896,7 @@ describe('module/swag-migration/component/swag-migration-error-resolution/swag-m await relationField.find('.sw-entity-single-select__selection').trigger('click'); await flushPromises(); - await relationField.find('.sw-select-result').trigger('click'); + await new DOMWrapper(document.body).find('.sw-select-result').trigger('click'); await flushPromises(); expect(wrapper.vm.fieldValue).toBe('tax-id-1'); diff --git a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-step.spec.js b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-step.spec.js index 5396372e8..887122cf7 100644 --- a/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-step.spec.js +++ b/tests/Jest/src/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-step.spec.js @@ -1,7 +1,7 @@ /** * @sw-package after-sales */ -import { mount } from '@vue/test-utils'; +import { DOMWrapper, mount } from '@vue/test-utils'; import SwagMigrationErrorResolutionStep, { MIGRATION_LOG_LEVEL, } from 'SwagMigrationAssistant/module/swag-migration/component/swag-migration-error-resolution/swag-migration-error-resolution-step'; @@ -377,8 +377,10 @@ describe('src/module/swag-migration/component/swag-migration-error-resolution/sw await wrapper.find('.sw-data-grid__row--0 .sw-data-grid__cell--actions button').trigger('click'); await flushPromises(); - expect(wrapper.find('.sw-context-button__menu-popover').exists()).toBe(true); - await wrapper.find('.swag-migration-error-resolution-step__card-table-edit').trigger('click'); + expect(new DOMWrapper(document.body).find('.sw-context-button__menu-popover').exists()).toBe(true); + await new DOMWrapper(document.body) + .find('.swag-migration-error-resolution-step__card-table-edit') + .trigger('click'); await flushPromises(); const modal = wrapper.find('swag-migration-error-resolution-modal-stub'); @@ -411,8 +413,10 @@ describe('src/module/swag-migration/component/swag-migration-error-resolution/sw await wrapper.find('.sw-data-grid__row--0 .sw-data-grid__cell--actions button').trigger('click'); await flushPromises(); - expect(wrapper.find('.sw-context-button__menu-popover').exists()).toBe(true); - await wrapper.find('.swag-migration-error-resolution-step__card-table-edit').trigger('click'); + expect(new DOMWrapper(document.body).find('.sw-context-button__menu-popover').exists()).toBe(true); + await new DOMWrapper(document.body) + .find('.swag-migration-error-resolution-step__card-table-edit') + .trigger('click'); await flushPromises(); expect(migrationApiServiceMock.getLogGroups).toHaveBeenCalledTimes(1);