|
@@ -46,7 +46,7 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
};
|
|
|
const filters = ['change', 'change_audit_list'];
|
|
|
const data = yield ctx.service.report.getReportData(params, filters);
|
|
|
- reportDataAnalysis.changeSort.fun(ctx, data);
|
|
|
+ reportDataAnalysis.analysisObj.changeSort.fun(ctx, data);
|
|
|
assert(data.change[0].code === 'test7-BG-001');
|
|
|
assert(data.change[2].code === 'test7-BG-003');
|
|
|
const changeCid = ctx.helper._.map(data.change, 'cid');
|
|
@@ -83,7 +83,7 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
]
|
|
|
});
|
|
|
assert(data.mem_stage_bills.length === 216);
|
|
|
- reportDataAnalysis.gatherGcl.fun(ctx, data, [
|
|
|
+ reportDataAnalysis.analysisObj.gatherGcl.fun(ctx, data, [
|
|
|
{field: 'b_code', table: 'mem_stage_bills'},
|
|
|
{field: 'name', table: 'mem_stage_bills'},
|
|
|
{field: 'unit', table: 'mem_stage_bills'},
|
|
@@ -91,7 +91,7 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
{field: 'is_leaf', table: 'mem_stage_bills'},
|
|
|
]);
|
|
|
assert(data.mem_stage_bills.length === 43);
|
|
|
- reportDataAnalysis.sortGcl.fun(ctx, data, [
|
|
|
+ reportDataAnalysis.analysisObj.sortGcl.fun(ctx, data, [
|
|
|
{field: 'b_code', table: 'mem_stage_bills'},
|
|
|
]);
|
|
|
const codeIndex = ctx.helper._.map(data.mem_stage_bills, 'b_code');
|
|
@@ -110,4 +110,17 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
assert(a === codeResult[i]);
|
|
|
});
|
|
|
});
|
|
|
+ it('test analysisDefine', function() {
|
|
|
+ const define = reportDataAnalysis.analysisDefine;
|
|
|
+ assert(define.length === 3);
|
|
|
+ assert(define[0].key === 'changeSort');
|
|
|
+ assert(define[0].name === reportDataAnalysis.analysisObj.changeSort.name);
|
|
|
+ assert(define[0].hint === reportDataAnalysis.analysisObj.changeSort.hint);
|
|
|
+ assert(define[1].key === 'gatherGcl');
|
|
|
+ assert(define[1].name === reportDataAnalysis.analysisObj.gatherGcl.name);
|
|
|
+ assert(define[1].hint === reportDataAnalysis.analysisObj.gatherGcl.hint);
|
|
|
+ assert(define[2].key === 'sortGcl');
|
|
|
+ assert(define[2].name === reportDataAnalysis.analysisObj.sortGcl.name);
|
|
|
+ assert(define[2].hint === reportDataAnalysis.analysisObj.sortGcl.hint);
|
|
|
+ });
|
|
|
});
|