import { createOptions, TestProjectId, TestTokens, setupTokens } from '../test.config'; import { FoundationPitService } from '../api/foundationPit.service'; jest.setTimeout(10000); const TestFoundationPitProjectId = '1441852'; const TestFoundationPitPointId = '5b978aa8ac546f00012b81a5'; const factory = createOptions(); const service = new FoundationPitService(factory); beforeAll(async () => { await setupTokens(); // console.log(TestTokens); }); test('加载基坑测量点汇总信息', async () => { const fpPointsCollect = await service.loadFouPitPointsCollect(TestProjectId); // console.log(fpPointsCollect ); expect(fpPointsCollect).not.toBeNull(); }); test('加载基坑测量点列表', async () => { const fpPointsList = await service.loadFouPitPointsList(TestFoundationPitProjectId); // console.log(JSON.stringify(fpPointsList)); expect(fpPointsList).not.toBeNull(); }); test('加载基坑测量点详情', async () => { const fpPointDetail = await service.loadFouPitPointDetail(TestProjectId, TestFoundationPitPointId); // console.log(JSON.stringify(fpPointDetail)); expect(fpPointDetail).not.toBeNull(); }); test('加载基坑背景图', async () => { const fpDraw = await service.loadFouPitDraw(TestProjectId); console.log(JSON.stringify(fpDraw)); // expect(fpPointsCollect).not.toBeNull(); // console.log(fpDraw[0].url); expect(fpDraw[0].url).toMatch(/https:\/\/*/); }); test('加载项目开始时间', async () => { const safeInfo = await service.loadSafeInfo(TestProjectId); console.log(JSON.stringify(safeInfo)); expect(safeInfo.startTime).not.toBeNull(); });