diff --git a/packages/editor-ui/src/views/CredentialsView.test.ts b/packages/editor-ui/src/views/CredentialsView.test.ts index d45c70c78b..aec4fd2c95 100644 --- a/packages/editor-ui/src/views/CredentialsView.test.ts +++ b/packages/editor-ui/src/views/CredentialsView.test.ts @@ -6,10 +6,14 @@ import { useUIStore } from '@/stores/ui.store'; import { mockedStore } from '@/__tests__/utils'; import { waitFor, within, fireEvent } from '@testing-library/vue'; import { CREDENTIAL_SELECT_MODAL_KEY, STORES } from '@/constants'; -import userEvent from '@testing-library/user-event'; import { useProjectsStore } from '@/stores/projects.store'; import type { Project } from '@/types/projects.types'; import { useRouter } from 'vue-router'; +vi.mock('@/composables/useGlobalEntityCreation', () => ({ + useGlobalEntityCreation: () => ({ + menu: [], + }), +})); vi.mock('vue-router', async () => { const actual = await vi.importActual('vue-router'); @@ -96,28 +100,6 @@ describe('CredentialsView', () => { renderComponent({ props: { credentialId: 'create' } }); expect(uiStore.openModal).toHaveBeenCalledWith(CREDENTIAL_SELECT_MODAL_KEY); }); - - it('should update credentialId route param to create', async () => { - const projectsStore = mockedStore(useProjectsStore); - projectsStore.isProjectHome = false; - projectsStore.currentProject = { scopes: ['credential:create'] } as Project; - const credentialsStore = mockedStore(useCredentialsStore); - credentialsStore.allCredentials = [ - { - id: '1', - name: 'test', - type: 'test', - createdAt: '2021-05-05T00:00:00Z', - updatedAt: '2021-05-05T00:00:00Z', - }, - ]; - const { getByTestId } = renderComponent(); - - await userEvent.click(getByTestId('resources-list-add')); - await waitFor(() => - expect(router.replace).toHaveBeenCalledWith({ params: { credentialId: 'create' } }), - ); - }); }); describe('open existing credential', () => { diff --git a/packages/editor-ui/src/views/CredentialsView.vue b/packages/editor-ui/src/views/CredentialsView.vue index 8d29191941..6b62a66fb3 100644 --- a/packages/editor-ui/src/views/CredentialsView.vue +++ b/packages/editor-ui/src/views/CredentialsView.vue @@ -26,7 +26,7 @@ import { getResourcePermissions } from '@/permissions'; import { useDocumentTitle } from '@/composables/useDocumentTitle'; import { useTelemetry } from '@/composables/useTelemetry'; import { useI18n } from '@/composables/useI18n'; -import { N8nButton, N8nInputLabel, N8nSelect, N8nOption } from 'n8n-design-system'; +import { N8nInputLabel, N8nSelect, N8nOption } from 'n8n-design-system'; const props = defineProps<{ credentialId?: string; @@ -192,19 +192,6 @@ onMounted(() => { -