Skip to content

Commit 74a1030

Browse files
committed
test: validate subgraph output link types
1 parent bf99d70 commit 74a1030

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

browser_tests/fixtures/helpers/SubgraphHelper.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ export class SubgraphHelper {
535535
if (!host) {
536536
return {
537537
rootLinks: ['no subgraph node'],
538-
incompatibleHostInputLinks: ['no subgraph node']
538+
incompatibleHostInputLinks: ['no subgraph node'],
539+
incompatibleHostOutputLinks: ['no subgraph node']
539540
}
540541
}
541542

@@ -558,6 +559,13 @@ export class SubgraphHelper {
558559
.map(
559560
(link) =>
560561
`${link.type} link landed on slot ${link.target_slot} typed ${host.inputs[link.target_slot]?.type}`
562+
),
563+
incompatibleHostOutputLinks: links
564+
.filter((link) => link.origin_id === host.id)
565+
.filter((link) => host.outputs[link.origin_slot]?.type !== link.type)
566+
.map(
567+
(link) =>
568+
`${link.type} link left slot ${link.origin_slot} typed ${host.outputs[link.origin_slot]?.type}`
561569
)
562570
}
563571
})

browser_tests/tests/subgraph/subgraphCreationBoundaryLinks.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const SUBGRAPH_LINKS_EXPECTED = {
1313
'7:0->HOST:2',
1414
'HOST:0->9:0'
1515
],
16-
incompatibleHostInputLinks: []
16+
incompatibleHostInputLinks: [],
17+
incompatibleHostOutputLinks: []
1718
} as const
1819

1920
test(

0 commit comments

Comments
 (0)