import { createOptions, TestProjectId, TestTokens, setupTokens } from '../test.config'; import { SmokeConfigService } from '../api/smokeConfig.service'; jest.setTimeout(10000); const factory = createOptions(); const service = new SmokeConfigService(factory); const programId = 'DS20171018'; const deviceIds = ['w123', '123455', '6534']; const deviceId = '34535'; const name = '烟感组合名称'; beforeAll(async () => { await setupTokens(); // console.log(TestTokens); }); test('加载烟感探测列表', async () => { const result = await service.loadSmokeList(TestProjectId); console.log('loadSmokeList', result); expect(result).not.toBeNull(); }); test('加载烟感探测组合列表', async () => { const result = await service.loadSmokeCombinationList(TestProjectId); console.log('loadSmokeCombinationList', result); expect(result).not.toBeNull(); }); test('创建烟感组合', async () => { const result = await service.createSmokeCombinstion(TestProjectId, deviceIds); console.log('createSmokeCombinstion', result); expect(result).not.toBeNull(); }); test('重命名烟感组合名称', async () => { const result = await service.editSmokeCombinstionName(TestProjectId, deviceId, name); console.log('deleteSmokeCombination', result); expect(result).not.toBeNull(); }); test('解绑烟感组合', async () => { const result = await service.deleteSmokeCombination(TestProjectId, deviceId); console.log('deleteSmokeCombination', result); expect(result).not.toBeNull(); }); test('解绑烟感组合详情', async () => { const result = await service.loadSmokeDetail(TestProjectId, deviceId); console.log('loadSmokeDetail', result); expect(result).not.toBeNull(); });