Skip to content

Commit 67d0c33

Browse files
committed
test(scripts): anchor the deferred-edge graph fixture on a module that still defers the registry
1 parent f012bc9 commit 67d0c33

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎scripts/check-application-graph.test.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,21 @@ describe('a deferred edge into a forbidden tree', () => {
122122
it('is reported when a root defers the load of a forbidden module', () => {
123123
/**
124124
* Walked from a module that defers the block registry — `const
125-
* { getBlockRegistry } = await import('@/blocks/registry')` — and nothing
126-
* else about it matters here. Before the deferred pass this root was green
127-
* on `blocks/`, which is the whole evasion in one line.
125+
* { getBlockRegistry } = await import('@/blocks/registry')`. A root's own
126+
* deferred edges are checked before its static imports, so the reported chain
127+
* is that single deferred hop, whatever else the root reaches.
128128
*/
129+
const root =
130+
'app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-mention-data.ts'
129131
const violations = findViolations({
130-
root: 'lib/copilot/chat/process-contents.ts',
132+
root,
131133
forbidden: { 'blocks/': FORBIDDEN_PREFIXES['blocks/'] },
132134
})
133135

134136
expect(violations).toHaveLength(1)
135137
expect(violations[0].forbidden).toBe('blocks/registry.ts')
136138
expect(violations[0].reason).toContain('deferred')
137-
expect(violations[0].path).toEqual([
138-
'lib/copilot/chat/process-contents.ts',
139-
'blocks/registry.ts',
140-
])
139+
expect(violations[0].path).toEqual([root, 'blocks/registry.ts'])
141140
})
142141

143142
/**

0 commit comments

Comments
 (0)