Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/repositories/baseOrgRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,6 @@ class BaseOrgRepository extends BaseRepository {
// Write - use org type specific model
if (registryObjectRaw.authority.includes('SECRETARIAT')) {
// Write
// testing:
registryObjectRaw.authority = 'SECRETARIAT'
const SecretariatObjectToSave = new SecretariatOrgModel(registryObjectRaw)
if (isSecretariat) {
registryObject = await SecretariatObjectToSave.save(options)
Expand Down
14 changes: 14 additions & 0 deletions test/integration-tests/audit/registryOrgCreatesAuditTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ describe('Create and Update Audit Collection with Org Endpoints', () => {
expect(auditObject.UUID).to.equal(org.uuid)
})

it('Should keep Secretariat audit authority consistent with stored org authority', async () => {
const org = await createTestOrg({
authority: ['SECRETARIAT']
})

const auditRes = await chai.request(app)
.get(`/api/audit/org/${org.uuid}`)
.set(constants.headers)

expect(auditRes).to.have.status(200)
expect(auditRes.body.history).to.be.an('array').with.lengthOf(1)
expect(auditRes.body.history[0].audit_object.authority).to.deep.equal(['SECRETARIAT'])
})

it('Should create separate audit documents for multiple orgs', async () => {
// Create multiple orgs
const [org1, org2, org3] = await Promise.all([
Expand Down
Loading