Skip to content

Commit a2b6860

Browse files
committed
Fixing failing test
1 parent b463177 commit a2b6860

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/unit-tests/org/registryOrgControllerTest.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ describe('Testing Registry Org Controller', () => {
3737
isSecretariat: sinon.stub().resolves(false),
3838
getOrg: sinon.stub().resolves({ UUID: 'org-uuid', short_name: 'activity_6' })
3939
}
40+
const userRepo = {
41+
isAdmin: sinon.stub().resolves(false)
42+
}
4043
const conversationRepo = {
4144
getAllByTargetUUID: sinon.stub().resolves([{
4245
UUID: 'conversation-uuid',
@@ -60,6 +63,7 @@ describe('Testing Registry Org Controller', () => {
6063
params: { identifier: 'activity_6' },
6164
repositories: {
6265
getBaseOrgRepository: () => orgRepo,
66+
getBaseUserRepository: () => userRepo,
6367
getConversationRepository: () => conversationRepo
6468
}
6569
}
@@ -76,6 +80,7 @@ describe('Testing Registry Org Controller', () => {
7680
expect(payload.conversation[0]).to.not.have.property('target_uuid')
7781
expect(payload.conversation[0]).to.not.have.property('_id')
7882
expect(payload.conversation[0]).to.not.have.property('__v')
83+
expect(userRepo.isAdmin.calledOnceWith('user@activity_6.com', 'activity_6', {})).to.equal(true)
7984
})
8085

8186
it('Should reject non-Secretariat access to another organization', async () => {

0 commit comments

Comments
 (0)