chore(junction): type facility provenance
This commit is contained in:
1 parent
8929edcee4
commit
db904d3194
2 files changed
+13
No files matched your search
@@ -22,6 +22,10 @@ const structure: JunctionStructure = {
|
||||
corners: [{ key: 'corner:a', label: '角部 A', fromArmKey: 'arm:a', toArmKey: 'arm:b' }],
|
||||
facilities: [{ key: 'crossing:a', label: '过街 A', kind: 'crossing' }],
|
||||
};
|
||||
structure.facilities[0].provenance = {
|
||||
facilityEvidence: 'source-crossing-node',
|
||||
crossingNodeIds: ['crossing-node-a'],
|
||||
};
|
||||
const feature = (object: string, junction = 'cluster:a', arm?: string): GeoFeature => ({
|
||||
type: 'Feature',
|
||||
properties: { junction_key: junction, object_key: object, arm_key: arm },
|
||||
@@ -98,6 +102,13 @@ describe('authoritative junction structures', () => {
|
||||
expect(junctionObjectFeatures(state, structure, 'deleted')).toEqual([]);
|
||||
});
|
||||
|
||||
it('keeps facility evidence available to scoped structure consumers', () => {
|
||||
expect(structure.facilities[0].provenance).toEqual({
|
||||
facilityEvidence: 'source-crossing-node',
|
||||
crossingNodeIds: ['crossing-node-a'],
|
||||
});
|
||||
});
|
||||
|
||||
it('scopes the canvas and preview using cluster ownership, retaining core features without node IDs', () => {
|
||||
const descriptor = junctionDescriptors(state).find((item) => item.ref.type === 'cluster')!;
|
||||
expect(descriptor.status).toBe('readonly');
|
||||
|
||||
Reference in new issue
Block a user