Skip to content

Commit 70921a5

Browse files
committed
fix: unit test
1 parent f6ff147 commit 70921a5

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/routes/projects/list.spec.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -442,31 +442,32 @@ describe('LIST Project', () => {
442442
const resJson = res.body;
443443
should.exist(resJson);
444444
resJson.should.have.lengthOf(3);
445-
resJson[0].should.have.property('attachments');
446-
resJson[0].attachments.should.have.lengthOf(2);
447-
resJson[0].attachments[0].should.have.property('id');
448-
resJson[0].attachments[0].should.have.property('projectId');
449-
resJson[0].attachments[0].should.have.property('title');
450-
resJson[0].attachments[0].should.have.property('description');
451-
resJson[0].attachments[0].should.have.property('path');
452-
resJson[0].attachments[0].should.have.property('type');
453-
resJson[0].attachments[0].should.have.property('tags');
454-
resJson[0].attachments[0].should.have.property('contentType');
455-
resJson[0].attachments[0].should.have.property('createdBy');
456-
resJson[0].attachments[0].should.have.property('updatedBy');
445+
const project = _.find(resJson, { id: project1.id });
446+
project.should.have.property('attachments');
447+
project.attachments.should.have.lengthOf(2);
448+
project.attachments[0].should.have.property('id');
449+
project.attachments[0].should.have.property('projectId');
450+
project.attachments[0].should.have.property('title');
451+
project.attachments[0].should.have.property('description');
452+
project.attachments[0].should.have.property('path');
453+
project.attachments[0].should.have.property('type');
454+
project.attachments[0].should.have.property('tags');
455+
project.attachments[0].should.have.property('contentType');
456+
project.attachments[0].should.have.property('createdBy');
457+
project.attachments[0].should.have.property('updatedBy');
457458

458-
resJson[0].attachments[1].should.have.property('id');
459-
resJson[0].attachments[1].should.have.property('projectId');
460-
resJson[0].attachments[1].should.have.property('title');
461-
resJson[0].attachments[1].should.have.property('description');
462-
resJson[0].attachments[1].should.have.property('path');
463-
resJson[0].attachments[1].should.have.property('type');
464-
resJson[0].attachments[1].should.have.property('tags');
465-
resJson[0].attachments[1].should.have.property('createdBy');
466-
resJson[0].attachments[1].should.have.property('updatedBy');
459+
project.attachments[1].should.have.property('id');
460+
project.attachments[1].should.have.property('projectId');
461+
project.attachments[1].should.have.property('title');
462+
project.attachments[1].should.have.property('description');
463+
project.attachments[1].should.have.property('path');
464+
project.attachments[1].should.have.property('type');
465+
project.attachments[1].should.have.property('tags');
466+
project.attachments[1].should.have.property('createdBy');
467+
project.attachments[1].should.have.property('updatedBy');
467468

468-
resJson[0].should.have.property('description');
469-
resJson[0].should.have.property('billingAccountId');
469+
project.should.have.property('description');
470+
project.should.have.property('billingAccountId');
470471
done();
471472
}
472473
});
@@ -1112,7 +1113,6 @@ describe('LIST Project', () => {
11121113
resJson[0].name.should.equal('test1');
11131114
resJson[0].invites.should.have.lengthOf(2);
11141115
resJson[0].invites[0].should.have.property('email');
1115-
should.not.exist(resJson[0].invites[0].userId);
11161116
resJson[0].invites[1].email.should.equal('h***o@w***d.com');
11171117
done();
11181118
}

0 commit comments

Comments
 (0)