Something went wrong. Try again.
TypeScript client for accessing TLE Community.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071import { getLacuna } from '../../__utils__/get-lacuna';import { expectMatchesApiSchema } from '../../__utils__/validate-schema';import { findBuilding } from '../../__utils__/find-building';import Lacuna from '../../lacuna';
let lacuna: Lacuna;// The fixture account currently has no Station Command Center anywhere -// all tests below are skipped (not failed) until one exists to test// against.let buildingId: number | undefined;
beforeAll(async () => { lacuna = await getLacuna(); const found = await findBuilding(lacuna, 'Station Command Center'); buildingId = found?.buildingId;});
test('view', async () => { if (buildingId === undefined) { console.warn('Skipping: no Station Command Center building on the fixture account'); return; }
const { result } = await lacuna.stationCommand.view({ building_id: buildingId });
expect(result?.building).toBeDefined(); expect(result?.building.name).toBe('Station Command Center'); expectMatchesApiSchema('stationcommand', 'view', result);});
test('getStatsForLevel', async () => { if (buildingId === undefined) { console.warn('Skipping: no Station Command Center building on the fixture account'); return; }
const { result } = await lacuna.stationCommand.getStatsForLevel({ building_id: buildingId, level: 1, });
expect(result?.building).toBeDefined(); expectMatchesApiSchema('stationcommand', 'get_stats_for_level', result);});
test('viewPlans', async () => { if (buildingId === undefined) { console.warn('Skipping: no Station Command Center building on the fixture account'); return; }
const { result } = await lacuna.stationCommand.viewPlans({ building_id: buildingId });
expect(result?.plans).toBeDefined(); expectMatchesApiSchema('stationcommand', 'view_plans', result);});
test('viewIncomingSupplyChains', async () => { if (buildingId === undefined) { console.warn('Skipping: no Station Command Center building on the fixture account'); return; }
const { result } = await lacuna.stationCommand.viewIncomingSupplyChains({ building_id: buildingId, });
expect(result?.supply_chains).toBeDefined(); expectMatchesApiSchema('stationcommand', 'view_incoming_supply_chains', result);});