The Kiwi codec types only symbolID, so every test reading symbolOverrides or uniformScaleFactor repeated the same cast against a type the package exported without the readers that go with it. symbolDataOf and symbolOverridesOf are now exported and five call sites use them. tests/engine/library exercises @/app/libraries, so it belongs under tests/app by the placement rules; the shard list and the engine baseline follow it.
21 lines
825 B
TypeScript
21 lines
825 B
TypeScript
import { symbolOverridesOf } from '@open-pencil/fig/instance-overrides'
|
|
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
|
|
|
|
import { expectDefined } from '../assert'
|
|
import { CapturedFigRecords, readFixture } from './fixtures'
|
|
|
|
const fixture = readFixture('nested-binding-ownership-records.json', CapturedFigRecords)
|
|
|
|
/** Remove only the placed owner's declaration, retaining the saved inherited expression. */
|
|
export function inheritedNestedBindingRecords(): NodeChange[] {
|
|
const changes = structuredClone(fixture.nodeChanges)
|
|
const owner = expectDefined(
|
|
changes.find((node) => node.guid?.sessionID === 293733 && node.guid.localID === 8),
|
|
'captured owner'
|
|
)
|
|
for (const override of symbolOverridesOf(owner)) {
|
|
Reflect.deleteProperty(override, 'parameterConsumptionMap')
|
|
}
|
|
return changes
|
|
}
|