[Reroute] Migrate floating link (#3260)

This commit is contained in:
Chenlei Hu
2025-03-27 22:13:16 -04:00
committed by GitHub
parent 25ce267b2e
commit 690326c374
8 changed files with 749 additions and 188 deletions

View File

@@ -14,22 +14,24 @@ describe('migrateReroute', () => {
return JSON.parse(fileContent) as WorkflowJSON04
}
it.each(['branching.json', 'single_connected.json', 'floating.json'])(
'should correctly migrate %s',
(fileName) => {
// Load the legacy workflow
const legacyWorkflow = loadWorkflow(
`workflows/reroute/legacy/${fileName}`
)
it.each([
'branching.json',
'single_connected.json',
'floating.json',
'floating_branch.json'
])('should correctly migrate %s', (fileName) => {
// Load the legacy workflow
const legacyWorkflow = loadWorkflow(
`workflows/reroute/legacy/${fileName}`
)
// Migrate the workflow
const migratedWorkflow = migrateLegacyRerouteNodes(legacyWorkflow)
// Migrate the workflow
const migratedWorkflow = migrateLegacyRerouteNodes(legacyWorkflow)
// Compare with snapshot
expect(JSON.stringify(migratedWorkflow, null, 2)).toMatchFileSnapshot(
`workflows/reroute/native/${fileName}`
)
}
)
// Compare with snapshot
expect(JSON.stringify(migratedWorkflow, null, 2)).toMatchFileSnapshot(
`workflows/reroute/native/${fileName}`
)
})
})
})