Skip to content

Commit

Permalink
fix: change the order of 'revoke' in e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShi-1 committed Oct 29, 2024
1 parent 742c88d commit c60e345
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const apiTokenInfoRepository = new ApiTokenInfoJSDataverseRepository()
describe('API Token Info JSDataverse Repository', () => {
before(() => TestsUtils.setup())
beforeEach(() => TestsUtils.login())
it('revoke the API token', async () => {
await expect(apiTokenInfoRepository.deleteApiToken()).to.be.fulfilled
})

it('create or recreate the API token and return the new token info', async () => {
const recreatedTokenInfo = await apiTokenInfoRepository.recreateApiToken()
Expand All @@ -21,16 +24,12 @@ describe('API Token Info JSDataverse Repository', () => {
expect(recreatedTokenInfo).to.have.property('expirationDate').that.is.a('string')
})

it('fetche the current API token', async () => {
it('fetch the current API token', async () => {
const tokenInfo = await apiTokenInfoRepository.getCurrentApiToken()
if (!tokenInfo) {
throw new Error('API Token not found')
}
expect(tokenInfo).to.have.property('apiToken').that.is.a('string')
expect(tokenInfo).to.have.property('expirationDate').that.is.a('string')
})

it('revoke the API token', async () => {
await expect(apiTokenInfoRepository.deleteApiToken()).to.be.fulfilled
})
})

0 comments on commit c60e345

Please sign in to comment.