import { SurveillanceServiceClient } from '../api/surveillance.service'; import { setupTokens, createOptions, TestTokens, TestProjectId } from '../test.config'; import { isEmpty } from 'lodash'; jest.setTimeout(10000); const factory = createOptions(); const service = new SurveillanceServiceClient(factory); const testentityId = '5b3b275bbe07770001c48649'; const testDeviceId = '4c666d2b-924c-44eb-afc2-4a2d19a701dc'; const testchannelId = '35564f1b-5712-4c2e-82ec-7091d468d039'; beforeAll(async () => { await setupTokens(); }); test('SurveillanceServiceClent 00 获取摄像头图片及事件', async () => { const surve = await service.loadSurveillanceImgEvent(TestProjectId, testDeviceId); console.log(surve); expect(isEmpty(surve)).toBe(false); }); test('SurveillanceServiceClent 01 获取直播地址', async () => { let instanceId = null; const data = { level: 0, playType: 'replay', startTime: '0', streamType: 'FLV', instanceId: '' }; // const pullUrl = await service.loadPullUrl('133819315007488', testentityId, testchannelId, data); // console.log(pullUrl); // expect(isEmpty(pullUrl)).toBe(false); }); test('SurveillanceServiceClent 02 获取摄像头分组', async () => { const surve = await service.loadVideoGroups(TestProjectId); console.log(surve); expect(isEmpty(surve)).toBe(false); });