From 002beffe87117495ce8fc2715a32e6ec6948765c Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Fri, 1 Nov 2024 15:30:43 +0100 Subject: [PATCH] Update test --- .../__tests__/useCanvasOperations.spec.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts b/packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts index 7128c223fef6c..ac71559d6566e 100644 --- a/packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts +++ b/packages/editor-ui/src/composables/__tests__/useCanvasOperations.spec.ts @@ -180,36 +180,6 @@ describe('useCanvasOperations', () => { expect(result.position).toEqual([20, 20]); }); - it('should create node with default credentials when only one credential is available', () => { - const credentialsStore = useCredentialsStore(); - const credential = mock({ id: '1', name: 'cred', type: 'cred' }); - const nodeTypeName = 'type'; - const nodeTypeDescription = mockNodeTypeDescription({ - name: nodeTypeName, - credentials: [{ name: credential.name }], - }); - - credentialsStore.state.credentials = { - [credential.id]: credential, - }; - - // @ts-expect-error Known pinia issue when spying on store getters - vi.spyOn(credentialsStore, 'getUsableCredentialByType', 'get').mockReturnValue(() => [ - credential, - ]); - - const { addNode } = useCanvasOperations({ router }); - const result = addNode( - { - type: nodeTypeName, - typeVersion: 1, - }, - nodeTypeDescription, - ); - - expect(result.credentials).toEqual({ [credential.name]: { id: '1', name: credential.name } }); - }); - it('should not assign credentials when multiple credentials are available', () => { const credentialsStore = useCredentialsStore(); const credentialA = mock({ id: '1', name: 'credA', type: 'cred' });