Something went wrong. Try again.
TypeScript client for accessing TLE Community.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344import { 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 Capitol anywhere - view/// getStatsForLevel are skipped (not failed) until one exists to test against.let buildingId: number | undefined;
beforeAll(async () => { lacuna = await getLacuna(); const found = await findBuilding(lacuna, 'Capitol'); buildingId = found?.buildingId;});
test('view', async () => { if (buildingId === undefined) { console.warn('Skipping: no Capitol building on the fixture account'); return; }
const { result } = await lacuna.capitol.view({ building_id: buildingId });
expect(result?.building).toBeDefined(); expect(result?.building.name).toBe('Capitol'); expectMatchesApiSchema('capitol', 'view', result);});
test('getStatsForLevel', async () => { if (buildingId === undefined) { console.warn('Skipping: no Capitol building on the fixture account'); return; }
const { result } = await lacuna.capitol.getStatsForLevel({ building_id: buildingId, level: 1, });
expect(result?.building).toBeDefined(); expectMatchesApiSchema('capitol', 'get_stats_for_level', result);});