Skip to content

Commit 43feafc

Browse files
committed
test(forks): use a neutral workflow name in preview fixtures
1 parent b610b2c commit 43feafc

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎apps/sim/app/api/workspaces/[id]/fork/workflow-diff/route.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ describe('fork workflow-diff route', () => {
7171
})
7272
mocks.loadForkBlockMap.mockResolvedValue({ parentToChild: new Map(), childToParent: new Map() })
7373
mocks.loadSourceDeployedWorkflow.mockImplementation(async (_ws: string, id: string) =>
74-
id === 'wf-src' ? { summary: { id, name: 'Ask Biz' }, state: emptyState } : null
74+
id === 'wf-src' ? { summary: { id, name: 'Support Agent' }, state: emptyState } : null
7575
)
7676
mocks.resolveForkPlanItem.mockResolvedValue({
7777
sourceWorkflowId: 'wf-src',
7878
targetWorkflowId: 'wf-tgt',
7979
targetName: null,
8080
mode: 'create',
81-
sourceMeta: { name: 'Ask Biz' },
81+
sourceMeta: { name: 'Support Agent' },
8282
})
8383
})
8484

@@ -138,8 +138,8 @@ describe('fork workflow-diff route', () => {
138138
targetWorkflowId: null,
139139
before: null,
140140
after: emptyState,
141-
beforeLabel: 'Ask Biz (current)',
142-
afterLabel: 'Ask Biz (deployed)',
141+
beforeLabel: 'Support Agent (current)',
142+
afterLabel: 'Support Agent (deployed)',
143143
})
144144
})
145145
it('maps a workflow whose target is excluded from sync to 404', async () => {
@@ -161,9 +161,9 @@ describe('fork workflow-diff route', () => {
161161
mocks.resolveForkPlanItem.mockResolvedValue({
162162
sourceWorkflowId: 'wf-src',
163163
targetWorkflowId: 'wf-tgt',
164-
targetName: 'Ask Biz prod',
164+
targetName: 'Support Agent prod',
165165
mode: 'replace',
166-
sourceMeta: { name: 'Ask Biz' },
166+
sourceMeta: { name: 'Support Agent' },
167167
})
168168
mocks.loadTargetDraftState.mockResolvedValue(targetState)
169169

@@ -181,7 +181,7 @@ describe('fork workflow-diff route', () => {
181181
await expect(response.json()).resolves.toMatchObject({
182182
targetWorkflowId: 'wf-tgt',
183183
before: targetState,
184-
beforeLabel: 'Ask Biz prod (current)',
184+
beforeLabel: 'Support Agent prod (current)',
185185
})
186186
})
187187
})

‎apps/sim/ee/workspace-forking/application/sync-workflow-diff.test.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,18 @@ function planItem(overrides: Record<string, unknown> = {}) {
7373
sourceWorkflowId: 'wf-src',
7474
targetWorkflowId: 'wf-tgt',
7575
mode: 'replace',
76-
sourceMeta: { name: 'Ask Biz' },
77-
targetName: 'Ask Biz (prod)',
76+
sourceMeta: { name: 'Support Agent' },
77+
targetName: 'Support Agent (prod)',
7878
...overrides,
7979
}
8080
}
8181

8282
/** The source loader, answering for `wf-src` only, as the real one answers for sync sources only. */
8383
function sourceIs(sourceState: WorkflowState | null) {
8484
mocks.loadSourceDeployedWorkflow.mockImplementation(async (_workspaceId: string, id: string) =>
85-
id === 'wf-src' && sourceState ? { summary: { id, name: 'Ask Biz' }, state: sourceState } : null
85+
id === 'wf-src' && sourceState
86+
? { summary: { id, name: 'Support Agent' }, state: sourceState }
87+
: null
8688
)
8789
}
8890

@@ -138,8 +140,8 @@ describe('getWorkspaceSyncWorkflowDiff', () => {
138140
})
139141
expect(result).toMatchObject({
140142
targetWorkflowId: 'wf-tgt',
141-
beforeLabel: 'Ask Biz (prod) (current)',
142-
afterLabel: 'Ask Biz (deployed)',
143+
beforeLabel: 'Support Agent (prod) (current)',
144+
afterLabel: 'Support Agent (deployed)',
143145
})
144146
expect(result.before).toEqual(state({ 'mapped-b1': {} }))
145147
expect(mocks.loadTargetDraftState).toHaveBeenCalledWith('wf-tgt', 'parent')
@@ -194,7 +196,7 @@ describe('getWorkspaceSyncWorkflowDiff', () => {
194196

195197
expect(result.before).toBeNull()
196198
expect(result.targetWorkflowId).toBeNull()
197-
expect(result.beforeLabel).toBe('Ask Biz (current)')
199+
expect(result.beforeLabel).toBe('Support Agent (current)')
198200
expect(mocks.loadTargetDraftState).not.toHaveBeenCalled()
199201
expect(mocks.loadForkBlockMap).not.toHaveBeenCalled()
200202
})

0 commit comments

Comments
 (0)