-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_mock.patch
More file actions
40 lines (38 loc) · 1.11 KB
/
Copy pathfix_mock.patch
File metadata and controls
40 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/web/src/components/workflows/WorkflowsView.edge-cases.test.tsx
+++ b/web/src/components/workflows/WorkflowsView.edge-cases.test.tsx
@@ -26,11 +26,18 @@ vi.mock('@/lib/client', () => ({
},
}));
-// Mock the workflow store
+// Mock the workflow store with stateful implementation
+const mockWorkflowStore = {
+ workflows: [],
+ phaseTemplates: [],
+ setWorkflows: vi.fn((workflows, _sources) => {
+ mockWorkflowStore.workflows = workflows;
+ }),
+ setPhaseTemplates: vi.fn((templates, _sources) => {
+ mockWorkflowStore.phaseTemplates = templates;
+ }),
+ refreshKey: 0,
+};
+
vi.mock('@/stores/workflowStore', () => ({
- useWorkflowStore: () => ({
- workflows: [],
- phaseTemplates: [],
- setWorkflows: vi.fn(),
- setPhaseTemplates: vi.fn(),
- refreshKey: 0,
- }),
+ useWorkflowStore: () => mockWorkflowStore,
}));
@@ -50,6 +57,10 @@ describe('WorkflowsView Redesign Edge Cases - TASK-750', () => {
beforeEach(() => {
vi.clearAllMocks();
+ // Reset mock store state
+ mockWorkflowStore.workflows = [];
+ mockWorkflowStore.phaseTemplates = [];
+ mockWorkflowStore.refreshKey = 0;
});
afterEach(() => {