Something went wrong. Try again.
TypeScript client for accessing TLE Community.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768import { getLacuna } from '../../__utils__/get-lacuna';import { expectMatchesApiSchema } from '../../__utils__/validate-schema';import { findBuilding } from '../../__utils__/find-building';import Lacuna from '../../lacuna';
let lacuna: Lacuna;let buildingId: number | undefined;
beforeAll(async () => { lacuna = await getLacuna(); const found = await findBuilding(lacuna, 'Intelligence Ministry'); buildingId = found?.buildingId;});
test('view', async () => { if (buildingId === undefined) { console.warn('Skipping: no Intelligence Ministry building on the fixture account'); return; }
const { result } = await lacuna.intelligence.view({ building_id: buildingId });
expect(result?.building).toBeDefined(); expect(result?.building.name).toBe('Intelligence Ministry'); expectMatchesApiSchema('intelligence', 'view', result);});
test('getStatsForLevel', async () => { if (buildingId === undefined) { console.warn('Skipping: no Intelligence Ministry building on the fixture account'); return; }
const { result } = await lacuna.intelligence.getStatsForLevel({ building_id: buildingId, level: 1, });
expect(result?.building).toBeDefined(); expectMatchesApiSchema('intelligence', 'get_stats_for_level', result);});
test('viewSpies', async () => { if (buildingId === undefined) { console.warn('Skipping: no Intelligence Ministry building on the fixture account'); return; }
const { result } = await lacuna.intelligence.viewSpies({ building_id: buildingId });
expect(result?.spies).toBeDefined(); expect(result?.spy_count).toBeDefined(); expectMatchesApiSchema('intelligence', 'view_spies', result);});
test('viewAllSpies', async () => { if (buildingId === undefined) { console.warn('Skipping: no Intelligence Ministry building on the fixture account'); return; }
const { result } = await lacuna.intelligence.viewAllSpies({ building_id: buildingId });
expect(result?.spies).toBeDefined(); expect(result?.spy_count).toBeDefined(); expectMatchesApiSchema('intelligence', 'view_all_spies', result);});