From 4541a8f2d17cb9ab2d7d874af5980ae1a39a5e09 Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen <10324676+tomi@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:23:30 +0300 Subject: [PATCH] refactor: Migrate `Select` to composition API (no-changelog) (#9750) --- .../N8nDatatable/__tests__/Datatable.spec.ts | 10 +- .../__snapshots__/Datatable.spec.ts.snap | 23 +- .../src/components/N8nSelect/Select.vue | 241 ++++++++---------- 3 files changed, 138 insertions(+), 136 deletions(-) diff --git a/packages/design-system/src/components/N8nDatatable/__tests__/Datatable.spec.ts b/packages/design-system/src/components/N8nDatatable/__tests__/Datatable.spec.ts index ccc2e544aeb24..53a738944df5b 100644 --- a/packages/design-system/src/components/N8nDatatable/__tests__/Datatable.spec.ts +++ b/packages/design-system/src/components/N8nDatatable/__tests__/Datatable.spec.ts @@ -2,7 +2,15 @@ import { render } from '@testing-library/vue'; import N8nDatatable from '../Datatable.vue'; import { rows, columns } from './data'; -const stubs = ['n8n-select', 'n8n-option', 'n8n-button', 'n8n-pagination']; +const stubs = [ + // Ideally we'd like to stub N8nSelect, but it doesn't work + // after migrating to setup script: + // https://github.com/vuejs/vue-test-utils/issues/2048 + // 'n8n-select', + 'n8n-option', + 'n8n-button', + 'n8n-pagination', +]; describe('components', () => { describe('N8nDatatable', () => { diff --git a/packages/design-system/src/components/N8nDatatable/__tests__/__snapshots__/Datatable.spec.ts.snap b/packages/design-system/src/components/N8nDatatable/__tests__/__snapshots__/Datatable.spec.ts.snap index 6fed9964f6ed8..0ebdd2e1ebc2d 100644 --- a/packages/design-system/src/components/N8nDatatable/__tests__/__snapshots__/Datatable.spec.ts.snap +++ b/packages/design-system/src/components/N8nDatatable/__tests__/__snapshots__/Datatable.spec.ts.snap @@ -97,7 +97,28 @@ exports[`components > N8nDatatable > should render correctly 1`] = ` " diff --git a/packages/design-system/src/components/N8nSelect/Select.vue b/packages/design-system/src/components/N8nSelect/Select.vue index 5e9d5e2318c44..27779ff5eea27 100644 --- a/packages/design-system/src/components/N8nSelect/Select.vue +++ b/packages/design-system/src/components/N8nSelect/Select.vue @@ -1,3 +1,108 @@ + +