import { 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, 'Network 19 Affiliate'); buildingId = found?.buildingId; }); test('view', async () => { if (buildingId === undefined) { console.warn('Skipping: no Network 19 Affiliate building on the fixture account'); return; } const { result } = await lacuna.network19.view({ building_id: buildingId }); expect(result?.building).toBeDefined(); expect(result?.building.name).toBe('Network 19 Affiliate'); expectMatchesApiSchema('network19', 'view', result); }); test('getStatsForLevel', async () => { if (buildingId === undefined) { console.warn('Skipping: no Network 19 Affiliate building on the fixture account'); return; } const { result } = await lacuna.network19.getStatsForLevel({ building_id: buildingId, level: 1, }); expect(result?.building).toBeDefined(); expectMatchesApiSchema('network19', 'get_stats_for_level', result); }); test('viewNews', async () => { if (buildingId === undefined) { console.warn('Skipping: no Network 19 Affiliate building on the fixture account'); return; } const { result } = await lacuna.network19.viewNews({ building_id: buildingId }); expect(result?.news).toBeDefined(); expectMatchesApiSchema('network19', 'view_news', result); }); // restrictCoverage flips a live on/off setting on the building - it's a // mutation, not a read, so it's intentionally not exercised here.