fix: Show actual execution data for production executions even if pin data exists (#6302)

This commit is contained in:
Alex Grozav
2023-06-01 19:12:21 +03:00
committed by GitHub
parent b5cabfef54
commit 4eb8437196
5 changed files with 85 additions and 31 deletions

View File

@@ -0,0 +1,31 @@
import { createTestingPinia } from '@pinia/testing';
import { useWorkflowsStore } from '@/stores';
let pinia: ReturnType<typeof createTestingPinia>;
beforeAll(() => {
pinia = createTestingPinia();
});
describe('Workflows Store', () => {
describe('shouldReplaceInputDataWithPinData', () => {
beforeEach(() => {
pinia.state.value = {
workflows: useWorkflowsStore(),
};
});
it('should return true if no active execution is set', () => {
expect(useWorkflowsStore().shouldReplaceInputDataWithPinData).toBe(true);
});
it('should return true if active execution is set and mode is manual', () => {
pinia.state.value.workflows.activeWorkflowExecution = { mode: 'manual' };
expect(useWorkflowsStore().shouldReplaceInputDataWithPinData).toBe(true);
});
it('should return false if active execution is set and mode is not manual', () => {
pinia.state.value.workflows.activeWorkflowExecution = { mode: 'webhook' };
expect(useWorkflowsStore().shouldReplaceInputDataWithPinData).toBe(false);
});
});
});