Skip to content

Commit

Permalink
fix: Add an additional unit test for imports.write
Browse files Browse the repository at this point in the history
  • Loading branch information
swetabar committed Sep 25, 2024
1 parent 5b39d52 commit 2d241f9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ describe('ApiKey Model tests', () => {
expect(apiKey.getScopes()).to.deep.equal([{ name: 'imports.write_all_domains', domains: [] }]);
});

it('creates an ApiKey object for a user with scope - imports.write', () => {
const apiKey = createApiKey({ ...validApiKey, scopes: [{ name: 'imports.write', domains: ['https://adobe.com', 'https://test.com'] }] });
expect(apiKey.getScopes()).to.deep.equal([{ name: 'imports.write', domains: ['https://adobe.com', 'https://test.com'] }]);
});

it('throws an error if revokedAt is not a valid date', () => {
expect(() => createApiKey({ ...validApiKey, revokedAt: 'invalid-date' })).to.throw('revokedAt should be a valid ISO 8601 string: invalid-date');
});
Expand Down

0 comments on commit 2d241f9

Please sign in to comment.