Skip to content

Commit

Permalink
tests: added more access token validations
Browse files Browse the repository at this point in the history
  • Loading branch information
artursudnik committed Jun 16, 2021
1 parent 6fa974c commit 1f13966
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/origin-backend/test/did-user.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ describe('DID user e2e tests', function () {
const accessToken = await loginDidUser(app, identityToken);

expect(accessToken).to.exist;

const tokenDecoded = jwt.verify(accessToken, process.env.JWT_SECRET) as {
did: string;
iat: string;
verifiedRoles: object[];
};

expect(tokenDecoded).to.contain.keys(['did', 'iat', 'verifiedRoles']);
expect(tokenDecoded.did).equal(did);
});

describe('when logged in as DID user', function () {
Expand Down

0 comments on commit 1f13966

Please sign in to comment.