import { getLacuna } from '../../__utils__/get-lacuna'; import { expectMatchesApiSchema } from '../../__utils__/validate-schema'; import { findBuilding } from '../../__utils__/find-building'; import Lacuna from '../../lacuna'; // `view` for planetaryCommand is already covered in lib/endpoints/building.test.ts - // this file covers getStatsForLevel plus planetaryCommand's own extra read methods. let lacuna: Lacuna; let buildingId: number | undefined; beforeAll(async () => { lacuna = await getLacuna(); const found = await findBuilding(lacuna, 'Planetary Command Center'); buildingId = found?.buildingId; }); test('getStatsForLevel', async () => { if (buildingId === undefined) { console.warn('Skipping: no Planetary Command Center building on the fixture account'); return; } const { result } = await lacuna.planetaryCommand.getStatsForLevel({ building_id: buildingId, level: 1, }); expect(result?.building).toBeDefined(); expectMatchesApiSchema('planetarycommand', 'get_stats_for_level', result); }); test('viewPlans', async () => { if (buildingId === undefined) { console.warn('Skipping: no Planetary Command Center building on the fixture account'); return; } const { result } = await lacuna.planetaryCommand.viewPlans({ building_id: buildingId }); expect(result?.plans).toBeDefined(); expectMatchesApiSchema('planetarycommand', 'view_plans', result); }); test('viewIncomingSupplyChains', async () => { if (buildingId === undefined) { console.warn('Skipping: no Planetary Command Center building on the fixture account'); return; } const { result } = await lacuna.planetaryCommand.viewIncomingSupplyChains({ building_id: buildingId, }); expect(result?.supply_chains).toBeDefined(); expectMatchesApiSchema('planetarycommand', 'view_incoming_supply_chains', result); }); // subsidizePodCooldown pays essentia to clear a cooldown - it's a mutation, // so it's intentionally not exercised here.