import { createOptions, setupTokens, TestTokens, TestProjectId, TestMenuId } from '../test.config'; import { LabourAssessService } from '../api/labourAssess.service'; jest.setTimeout(10000); const factory = createOptions(); const service = new LabourAssessService(factory); beforeAll(async () => { await setupTokens(); console.log('tokens are loaded'); console.log(TestTokens); }); // 注: 部分接口需要id等,建议postman进行配合测试接口 test('获取劳务相关最小日期限制', async () => { const result = await service.loadMinCreateDate(TestProjectId); console.log('获取劳务相关最小日期限制', result); }); test('获取劳务评分基础设置列表', async () => { const result = await service.loadScoreBaseItems(TestProjectId); console.log('获取劳务评分基础设置列表', result); }); test('获取评分规则列表,包括质量、安全、生产评分规则', async () => { const result = await service.loadScoreRuleItems(TestProjectId); console.log('查询肤色主题配置', result); }); test('按月获取其他评分规则列表', async () => { const result = await service.loadOtherScoreRuleItemsByMonth(TestProjectId, { year: 2019, month: 5 }); console.log('按月获取其他评分规则列表', result); }); test('根据项目ID获取劳务分包单位列表', async () => { const result = await service.loadSubcontractorsList(TestProjectId); console.log('根据项目ID获取劳务分包单位列表', result); }); test('根据年份,月份获取劳务评分列表', async () => { const result = await service.loadLaborScoresByDate(TestProjectId, { year: 2019, month: 5 }); console.log('根据年份,月份获取劳务评分列表', result); }); test('获取近12个月的劳务评分列表', async () => { const result = await service.loadLaborRecentMonth(TestProjectId); console.log('获取近12个月的劳务评分列表', result); }); test('获取大屏数据', async () => { const result = await service.loadSimulationResourceUrl(TestProjectId); console.log('获取大屏数据', result); })