Skip to content

Commit

Permalink
finish tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Sep 9, 2024
1 parent 54b1997 commit d633f08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ import { resetConfig } from './config.js'
const exchangeSetupPath = '/exchange/setup'
const unprotectedTenantName = "UN_PROTECTED_TEST"
const protectedTenantName = "PROTECTED_TEST"
const protectedTenantName2 = "PROTECTED_TEST_2"
const randomTenantName = "RANDOM_TEST"

let unprotectedTenantToken
let protectedTenantToken
let testTenantToken2
let randomToken

let statusUpdateBody
Expand All @@ -49,6 +52,7 @@ describe('api', () => {
before(async () => {
unprotectedTenantToken = process.env[`TENANT_TOKEN_${unprotectedTenantName}`]
protectedTenantToken = process.env[`TENANT_TOKEN_${protectedTenantName}`]
testTenantToken2 = process.env[`TENANT_TOKEN_${protectedTenantName2}`]
randomToken = process.env[`TENANT_TOKEN_${randomTenantName}`]
statusUpdateBody = { "credentialId": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", "credentialStatus": [{ "type": "BitstringStatusListCredential", "status": "revoked" }] }
});
Expand Down Expand Up @@ -393,14 +397,14 @@ describe('api', () => {
.expect('Content-Type', /json/)
})

/* it('returns 403 when trying to use token for a different tenant', done => {
it('returns 403 when trying to use token for a different tenant', done => {
request(app)
.post(`/instance/${protectedTenantName}/credentials/status`)
.set('Authorization', `Bearer ${testTenantToken2}`)
.send(statusUpdateBody)
.expect('Content-Type', /json/)
.expect(403, done)
}) */
})


it('update unprotected status when token not set for tenant in config', done => {
Expand Down
1 change: 1 addition & 0 deletions src/test-fixtures/.env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

TENANT_TOKEN_UN_PROTECTED_TEST=UNPROTECTED
TENANT_TOKEN_PROTECTED_TEST=jds
TENANT_TOKEN_PROTECTED_TEST_2=hgf
TENANT_TOKEN_RANDOM_TEST=UNPROTECTED

# The tenant name is specified in the issuing/status invocations like so
Expand Down

0 comments on commit d633f08

Please sign in to comment.