Skip to content

Commit 64529e4

Browse files
committed
test(workflows): use absolute imports in new tests
1 parent 5c28dd5 commit 64529e4

5 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/compare-pair.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @vitest-environment node
33
*/
44
import { describe, expect, it } from 'vitest'
5-
import { resolveComparePair } from './compare-pair'
5+
import { resolveComparePair } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/compare-pair'
66

77
describe('resolveComparePair', () => {
88
it('puts the older version on the base side whichever was clicked', () => {

‎apps/sim/app/workspace/[workspaceId]/w/components/workflow-diff/components/change-list/text-diff-lines.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
ONE_SIDED_VISIBLE_LINES,
1313
splitLines,
1414
toLines,
15-
} from './text-diff-lines'
15+
} from '@/app/workspace/[workspaceId]/w/components/workflow-diff/components/change-list/text-diff-lines'
1616

1717
const context = (count: number): DiffLine[] =>
1818
Array.from({ length: count }, (_, index) => ({ kind: 'context', text: `ctx ${index}` }))

‎apps/sim/app/workspace/[workspaceId]/w/components/workflow-diff/utils.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
*/
44
import { beforeEach, describe, expect, it, vi } from 'vitest'
55
import type { WorkflowDiffSummary } from '@/lib/workflows/comparison'
6-
import { getBlock } from '@/blocks/registry'
7-
import type { SubBlockConfig } from '@/blocks/types'
8-
import type { BlockState, WorkflowState } from '@/stores/workflows/workflow/types'
96
import {
107
classifyChange,
118
describeListItems,
@@ -19,7 +16,10 @@ import {
1916
toDiffText,
2017
toItemList,
2118
toMessageList,
22-
} from './utils'
19+
} from '@/app/workspace/[workspaceId]/w/components/workflow-diff/utils'
20+
import { getBlock } from '@/blocks/registry'
21+
import type { SubBlockConfig } from '@/blocks/types'
22+
import type { BlockState, WorkflowState } from '@/stores/workflows/workflow/types'
2323

2424
/** The global registry mock returns no sub-blocks; tests declare the ones they need per block type. */
2525
function declareSubBlocks(byType: Record<string, Partial<SubBlockConfig>[]>) {

‎apps/sim/lib/workflows/comparison/compare.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import {
66
createWorkflowState as createTestWorkflowState,
77
} from '@sim/testing'
88
import { describe, expect, it } from 'vitest'
9-
import type { WorkflowState } from '@/stores/workflows/workflow/types'
109
import {
1110
containerConfigFields,
1211
generateWorkflowDiffSummary,
1312
hasWorkflowChanged,
1413
omitPresentationChanges,
1514
type WorkflowDiffSummary,
16-
} from './compare'
15+
} from '@/lib/workflows/comparison/compare'
16+
import type { WorkflowState } from '@/stores/workflows/workflow/types'
1717

1818
/**
1919
* Type helper for converting test workflow state to app workflow state.

‎apps/sim/lib/workflows/comparison/overlay.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
* @vitest-environment node
33
*/
44
import { describe, expect, it } from 'vitest'
5+
import {
6+
generateWorkflowDiffSummary,
7+
type WorkflowDiffSummary,
8+
} from '@/lib/workflows/comparison/compare'
9+
import { buildWorkflowDiffOverlay } from '@/lib/workflows/comparison/overlay'
510
import type { WorkflowState } from '@/stores/workflows/workflow/types'
6-
import { generateWorkflowDiffSummary, type WorkflowDiffSummary } from './compare'
7-
import { buildWorkflowDiffOverlay } from './overlay'
811

912
/** Overlay only reads position, data and ids; the cast keeps the fixtures short. */
1013
function asState(state: Record<string, unknown>): WorkflowState {

0 commit comments

Comments
 (0)