Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Jul 30, 2024
1 parent 0122e81 commit 6145148
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { createTestNode } from '@/__tests__/mocks';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { CUSTOM_API_CALL_KEY } from '@/constants';

const { isCustomApiCallSelected } = useNodeHelpers();

vi.mock('@/stores/workflows.store', () => ({
useWorkflowsStore: vi.fn(),
}));
Expand All @@ -25,7 +23,7 @@ describe('useNodeHelpers()', () => {
const nodeValues = {
parameters: { resource: CUSTOM_API_CALL_KEY },
};
expect(isCustomApiCallSelected(nodeValues)).toBe(true);
expect(useNodeHelpers().isCustomApiCallSelected(nodeValues)).toBe(true);
});

test('should return `true` when operation includes `CUSTOM_API_CALL_KEY`', () => {
Expand All @@ -34,7 +32,7 @@ describe('useNodeHelpers()', () => {
operation: CUSTOM_API_CALL_KEY,
},
};
expect(isCustomApiCallSelected(nodeValues)).toBe(true);
expect(useNodeHelpers().isCustomApiCallSelected(nodeValues)).toBe(true);
});

test('should return `false` when neither resource nor operation includes `CUSTOM_API_CALL_KEY`', () => {
Expand All @@ -44,7 +42,7 @@ describe('useNodeHelpers()', () => {
operation: 'get',
},
};
expect(isCustomApiCallSelected(nodeValues)).toBe(false);
expect(useNodeHelpers().isCustomApiCallSelected(nodeValues)).toBe(false);
});
});

Expand Down

0 comments on commit 6145148

Please sign in to comment.