workflowのソート条件の指定に誤りがあったので修正
テストもその誤りを検知できるように修正
This commit is contained in:
parent
3ac1218a6b
commit
d23336a065
@ -82,13 +82,13 @@ describe('getWorkflows', () => {
|
|||||||
const { id: worktypeId1 } = await createWorktype(
|
const { id: worktypeId1 } = await createWorktype(
|
||||||
source,
|
source,
|
||||||
account.id,
|
account.id,
|
||||||
'worktype1',
|
'worktype2',
|
||||||
);
|
);
|
||||||
|
|
||||||
const { id: worktypeId2 } = await createWorktype(
|
const { id: worktypeId2 } = await createWorktype(
|
||||||
source,
|
source,
|
||||||
account.id,
|
account.id,
|
||||||
'worktype2',
|
'worktype1',
|
||||||
);
|
);
|
||||||
|
|
||||||
const { id: templateId1 } = await createTemplateFile(
|
const { id: templateId1 } = await createTemplateFile(
|
||||||
@ -102,7 +102,7 @@ describe('getWorkflows', () => {
|
|||||||
source,
|
source,
|
||||||
account.id,
|
account.id,
|
||||||
authorId1,
|
authorId1,
|
||||||
worktypeId1,
|
worktypeId2,
|
||||||
templateId1,
|
templateId1,
|
||||||
);
|
);
|
||||||
const workflow2 = await createWorkflow(
|
const workflow2 = await createWorkflow(
|
||||||
@ -116,14 +116,14 @@ describe('getWorkflows', () => {
|
|||||||
source,
|
source,
|
||||||
account.id,
|
account.id,
|
||||||
authorId3,
|
authorId3,
|
||||||
worktypeId2,
|
worktypeId1,
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
const workflow4 = await createWorkflow(
|
const workflow4 = await createWorkflow(
|
||||||
source,
|
source,
|
||||||
account.id,
|
account.id,
|
||||||
authorId3,
|
authorId3,
|
||||||
worktypeId1,
|
worktypeId2,
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ describe('getWorkflows', () => {
|
|||||||
expect(workflows.length).toBe(4);
|
expect(workflows.length).toBe(4);
|
||||||
expect(workflows[0].id).toBe(workflow1.id);
|
expect(workflows[0].id).toBe(workflow1.id);
|
||||||
expect(workflows[0].author_id).toBe(authorId1);
|
expect(workflows[0].author_id).toBe(authorId1);
|
||||||
expect(workflows[0].worktype_id).toBe(worktypeId1);
|
expect(workflows[0].worktype_id).toBe(worktypeId2);
|
||||||
expect(workflows[0].template_id).toBe(templateId1);
|
expect(workflows[0].template_id).toBe(templateId1);
|
||||||
|
|
||||||
expect(workflows[1].id).toBe(workflow2.id);
|
expect(workflows[1].id).toBe(workflow2.id);
|
||||||
@ -151,12 +151,12 @@ describe('getWorkflows', () => {
|
|||||||
|
|
||||||
expect(workflows[2].id).toBe(workflow3.id);
|
expect(workflows[2].id).toBe(workflow3.id);
|
||||||
expect(workflows[2].author_id).toBe(authorId3);
|
expect(workflows[2].author_id).toBe(authorId3);
|
||||||
expect(workflows[2].worktype_id).toBe(worktypeId2);
|
expect(workflows[2].worktype_id).toBe(worktypeId1);
|
||||||
expect(workflows[2].template_id).toBe(null);
|
expect(workflows[2].template_id).toBe(null);
|
||||||
|
|
||||||
expect(workflows[3].id).toBe(workflow4.id);
|
expect(workflows[3].id).toBe(workflow4.id);
|
||||||
expect(workflows[3].author_id).toBe(authorId3);
|
expect(workflows[3].author_id).toBe(authorId3);
|
||||||
expect(workflows[3].worktype_id).toBe(worktypeId1);
|
expect(workflows[3].worktype_id).toBe(worktypeId2);
|
||||||
expect(workflows[3].template_id).toBe(null);
|
expect(workflows[3].template_id).toBe(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ describe('getWorkflows', () => {
|
|||||||
expect(resWorkflows[1].id).toBe(workflow1.id);
|
expect(resWorkflows[1].id).toBe(workflow1.id);
|
||||||
expect(resWorkflows[1].author.id).toBe(authorId1);
|
expect(resWorkflows[1].author.id).toBe(authorId1);
|
||||||
expect(resWorkflows[1].author.authorId).toBe('BBBBB');
|
expect(resWorkflows[1].author.authorId).toBe('BBBBB');
|
||||||
expect(resWorkflows[1].worktype?.id).toBe(worktypeId1);
|
expect(resWorkflows[1].worktype?.id).toBe(worktypeId2);
|
||||||
expect(resWorkflows[1].worktype?.worktypeId).toBe('worktype1');
|
expect(resWorkflows[1].worktype?.worktypeId).toBe('worktype1');
|
||||||
expect(resWorkflows[1].template?.id).toBe(templateId1);
|
expect(resWorkflows[1].template?.id).toBe(templateId1);
|
||||||
expect(resWorkflows[1].template?.fileName).toBe('fileName1');
|
expect(resWorkflows[1].template?.fileName).toBe('fileName1');
|
||||||
@ -194,7 +194,7 @@ describe('getWorkflows', () => {
|
|||||||
expect(resWorkflows[2].id).toBe(workflow4.id);
|
expect(resWorkflows[2].id).toBe(workflow4.id);
|
||||||
expect(resWorkflows[2].author.id).toBe(authorId3);
|
expect(resWorkflows[2].author.id).toBe(authorId3);
|
||||||
expect(resWorkflows[2].author.authorId).toBe('CCCCC');
|
expect(resWorkflows[2].author.authorId).toBe('CCCCC');
|
||||||
expect(resWorkflows[2].worktype?.id).toBe(worktypeId1);
|
expect(resWorkflows[2].worktype?.id).toBe(worktypeId2);
|
||||||
expect(resWorkflows[2].worktype?.worktypeId).toBe('worktype1');
|
expect(resWorkflows[2].worktype?.worktypeId).toBe('worktype1');
|
||||||
expect(resWorkflows[2].template).toBe(undefined);
|
expect(resWorkflows[2].template).toBe(undefined);
|
||||||
expect(resWorkflows[2].typists.length).toBe(1);
|
expect(resWorkflows[2].typists.length).toBe(1);
|
||||||
@ -204,7 +204,7 @@ describe('getWorkflows', () => {
|
|||||||
expect(resWorkflows[3].id).toBe(workflow3.id);
|
expect(resWorkflows[3].id).toBe(workflow3.id);
|
||||||
expect(resWorkflows[3].author.id).toBe(authorId3);
|
expect(resWorkflows[3].author.id).toBe(authorId3);
|
||||||
expect(resWorkflows[3].author.authorId).toBe('CCCCC');
|
expect(resWorkflows[3].author.authorId).toBe('CCCCC');
|
||||||
expect(resWorkflows[3].worktype?.id).toBe(worktypeId2);
|
expect(resWorkflows[3].worktype?.id).toBe(worktypeId1);
|
||||||
expect(resWorkflows[3].worktype?.worktypeId).toBe('worktype2');
|
expect(resWorkflows[3].worktype?.worktypeId).toBe('worktype2');
|
||||||
expect(resWorkflows[3].template).toBe(undefined);
|
expect(resWorkflows[3].template).toBe(undefined);
|
||||||
expect(resWorkflows[3].typists.length).toBe(1);
|
expect(resWorkflows[3].typists.length).toBe(1);
|
||||||
|
|||||||
@ -53,7 +53,9 @@ export class WorkflowsRepositoryService {
|
|||||||
author: {
|
author: {
|
||||||
author_id: 'ASC',
|
author_id: 'ASC',
|
||||||
},
|
},
|
||||||
worktype_id: 'ASC',
|
worktype: {
|
||||||
|
custom_worktype_id: 'ASC',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
comment: `${context.getTrackingId()}_${new Date().toUTCString()}`,
|
comment: `${context.getTrackingId()}_${new Date().toUTCString()}`,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user