feat(editor): Workflow history [WIP]- Improve switching between workflow history and editor (no-changelog) (#7353)

This commit is contained in:
Csaba Tuncsik
2023-10-05 15:49:59 +02:00
committed by GitHub
parent 1a661e6d00
commit cd12a5990a
7 changed files with 48 additions and 71 deletions

View File

@@ -14,6 +14,7 @@ import {
workflowHistoryDataFactory,
workflowVersionDataFactory,
} from '@/stores/__tests__/utils/workflowHistoryTestUtils';
import type { WorkflowVersion } from '@/types/workflowHistory';
vi.mock('vue-router', () => {
const params = {};
@@ -34,7 +35,7 @@ vi.mock('vue-router', () => {
const workflowId = faker.string.nanoid();
const historyData = Array.from({ length: 5 }, workflowHistoryDataFactory);
const versionData = {
const versionData: WorkflowVersion = {
...workflowVersionDataFactory(),
...historyData[0],
};
@@ -76,8 +77,7 @@ describe('WorkflowHistory', () => {
router = useRouter();
vi.spyOn(workflowHistoryStore, 'getWorkflowHistory').mockResolvedValue(historyData);
vi.spyOn(workflowHistoryStore, 'workflowHistory', 'get').mockReturnValue(historyData);
vi.spyOn(workflowHistoryStore, 'activeWorkflowVersion', 'get').mockReturnValue(versionData);
vi.spyOn(workflowHistoryStore, 'getWorkflowVersion').mockResolvedValue(versionData);
windowOpenSpy = vi.spyOn(window, 'open').mockImplementation(() => null);
});