diff --git a/packages/_vue3-migration-test/src/components/index.ts b/packages/_vue3-migration-test/src/components/index.ts index 5ee75b14a3..9bc8c5951e 100644 --- a/packages/_vue3-migration-test/src/components/index.ts +++ b/packages/_vue3-migration-test/src/components/index.ts @@ -10,3 +10,4 @@ export { default as TestUseLayouts } from './test-use-layouts.vue'; export { default as TestBaseSuggestions } from './suggestions/test-base-suggestions.vue'; export { default as TestHighlight } from './test-highlight.vue'; export { default as TestBaseResultImages } from './result/test-base-result-images.vue'; +export { default as TestBasePanel } from './panels/test-base-panel.vue'; diff --git a/packages/_vue3-migration-test/src/components/panels/test-base-panel.vue b/packages/_vue3-migration-test/src/components/panels/test-base-panel.vue new file mode 100644 index 0000000000..714b37b7b5 --- /dev/null +++ b/packages/_vue3-migration-test/src/components/panels/test-base-panel.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/packages/_vue3-migration-test/src/router.ts b/packages/_vue3-migration-test/src/router.ts index 89dff78109..b379899eae 100644 --- a/packages/_vue3-migration-test/src/router.ts +++ b/packages/_vue3-migration-test/src/router.ts @@ -24,7 +24,8 @@ import { TestSlidingPanel, TestBaseSuggestions, TestHighlight, - TestBaseResultImages + TestBaseResultImages, + TestBasePanel } from './'; const routes = [ @@ -152,6 +153,11 @@ const routes = [ path: '/base-result-images', name: 'BaseResultImages', component: TestBaseResultImages + }, + { + path: '/test-base-panel', + name: 'TestBasePanel', + component: TestBasePanel } ]; diff --git a/packages/x-components/src/components/panels/__tests__/base-header-toggle-panel.spec.ts b/packages/x-components/src/components/panels/__tests__/base-header-toggle-panel.spec.ts index df08f9863b..3bdff9e84b 100644 --- a/packages/x-components/src/components/panels/__tests__/base-header-toggle-panel.spec.ts +++ b/packages/x-components/src/components/panels/__tests__/base-header-toggle-panel.spec.ts @@ -1,7 +1,7 @@ import { mount, Wrapper } from '@vue/test-utils'; import Vue from 'vue'; import { getDataTestSelector } from '../../../__tests__/utils'; -import BaseHeaderTogglePanelComponent from '../base-header-toggle-panel.vue'; +import BaseHeaderTogglePanel from '../base-header-toggle-panel.vue'; /** * Function that returns a BaseHeaderTogglePanel wrapper. The animation prop is not gonna be tested @@ -16,12 +16,12 @@ function renderBaseHeaderTogglePanel({ }: RenderBaseTogglePanelOptions = {}): RenderBaseHeaderTogglePanelAPI { const wrapperContainer = mount({ components: { - BaseHeaderTogglePanel: BaseHeaderTogglePanelComponent + BaseHeaderTogglePanel }, template }); - const wrapper = wrapperContainer.findComponent(BaseHeaderTogglePanelComponent); + const wrapper = wrapperContainer.findComponent(BaseHeaderTogglePanel); const headerWrapper = wrapper.find(getDataTestSelector('toggle-panel-header')); return { @@ -62,6 +62,7 @@ describe('testing BaseHeaderTogglePanel component', () => { it('emits its open status as an event on header click', async () => { const { wrapper, toggleOpen } = renderBaseHeaderTogglePanel(); + await toggleOpen(); expect(wrapper.emitted().close).toHaveLength(1); await toggleOpen(); diff --git a/packages/x-components/src/components/panels/base-header-toggle-panel.vue b/packages/x-components/src/components/panels/base-header-toggle-panel.vue index 54c63b618f..add00425f4 100644 --- a/packages/x-components/src/components/panels/base-header-toggle-panel.vue +++ b/packages/x-components/src/components/panels/base-header-toggle-panel.vue @@ -22,11 +22,9 @@