fix(reference): preserve station evidence and rollback schema
This commit is contained in:
@@ -16,6 +16,7 @@ test('reference readers search normalized types and expose group/category/system
|
||||
universe.regions = { '10000001': { region_id: 10000001, name: 'The Forge' } };
|
||||
universe.constellations = { '20000020': { constellation_id: 20000020, name: 'Kimotoro', region_id: 10000001 } };
|
||||
universe.stations = { '60003760': { station_id: 60003760, system_id: 30000142, name: 'Jita IV - Moon 4 - Caldari Navy Assembly Plant', type_id: 587, owner_id: 1000035, position: { x: 1, y: 2, z: 3 } } };
|
||||
(universe.systems as Record<string, Record<string, unknown>>)['30000142'].stations = [60003761];
|
||||
await writeFile(universePath, JSON.stringify(universe));
|
||||
|
||||
const result = await new ReferenceCompiler({ directory, profile: 'fixture', sources: fixtureSources(sources) }).compile();
|
||||
@@ -28,7 +29,13 @@ test('reference readers search normalized types and expose group/category/system
|
||||
expect(await reader.groups({ categoryId: 4 })).toEqual([{ id: 18, categoryId: 4, name: 'Mineral', published: true }]);
|
||||
expect(await reader.regions({ query: 'forge' })).toEqual([{ id: 10000001, name: 'The Forge' }]);
|
||||
expect(await reader.systems({ regionId: 10000001 })).toEqual([{ id: 30000142, name: 'Jita', constellationId: 20000020, regionId: 10000001, x: -129064861735000000, y: 60755306910000000, z: 117469227060000000, securityStatus: 0.9459131360054016, securityClass: null }]);
|
||||
expect(await reader.stations({ systemId: 30000142 })).toEqual([{ id: 60003760, systemId: 30000142, systemName: 'Jita', regionId: 10000001, name: 'Jita IV - Moon 4 - Caldari Navy Assembly Plant', typeId: 587, ownerId: 1000035, x: 1, y: 2, z: 3 }]);
|
||||
const stations = await reader.stations({ systemId: 30000142 });
|
||||
expect(stations).toHaveLength(2);
|
||||
expect(stations).toEqual([
|
||||
{ id: 60003760, systemId: 30000142, systemName: 'Jita', regionId: 10000001, sourceVerified: true, name: 'Jita IV - Moon 4 - Caldari Navy Assembly Plant', typeId: 587, ownerId: 1000035, x: 1, y: 2, z: 3 },
|
||||
{ id: 60003761, systemId: 30000142, systemName: 'Jita', regionId: 10000001, sourceVerified: false, name: null, typeId: null, ownerId: null, x: null, y: null, z: null },
|
||||
]);
|
||||
expect(await reader.stations({ query: 'assembly' })).toEqual([stations[0]]);
|
||||
const pinned = reader.pin();
|
||||
try { expect((await pinned.searchTypesByName('pyerite'))[0]?.id).toBe(35); }
|
||||
finally { pinned.close(); }
|
||||
|
||||
Reference in New Issue
Block a user