-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add it for group api - OKTA-288652 (#154)
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const expect = require('chai').expect; | ||
const okta = require('../../src'); | ||
const models = require('../../src/models'); | ||
const Collection = require('../../src/collection'); | ||
const utils = require('../utils'); | ||
const mockGroup = require('./mocks/group.json'); | ||
let orgUrl = process.env.OKTA_CLIENT_ORGURL; | ||
|
||
if (process.env.OKTA_USE_MOCK) { | ||
orgUrl = `${orgUrl}/group-app`; | ||
} | ||
|
||
const client = new okta.Client({ | ||
orgUrl: orgUrl, | ||
token: process.env.OKTA_CLIENT_TOKEN, | ||
requestExecutor: new okta.DefaultRequestExecutor() | ||
}); | ||
|
||
describe('Group App API', () => { | ||
describe('List assigned applications', () => { | ||
let application; | ||
let group; | ||
let groupAssignment; | ||
beforeEach(async () => { | ||
const mockApplication = utils.getBookmarkApplication(); | ||
application = await client.createApplication(mockApplication); | ||
group = await client.createGroup(mockGroup); | ||
groupAssignment = await application.createApplicationGroupAssignment(group.id); | ||
}); | ||
afterEach(async () => { | ||
await groupAssignment.delete(application.id); | ||
await application.deactivate(); | ||
await application.delete(); | ||
await group.delete(); | ||
}); | ||
|
||
it('should return a Collection', async () => { | ||
const applications = await group.listApplications(); | ||
expect(applications).to.be.instanceOf(Collection); | ||
}); | ||
|
||
it('should resolve Application in collection', async () => { | ||
await group.listApplications().each(application => { | ||
expect(application).to.be.instanceOf(models.Application); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"profile": { | ||
"name": "Application delete group" | ||
} | ||
} |