Skip to content

Commit

Permalink
stackRoleMapping test cases in types support
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithad0703 committed Nov 10, 2023
1 parent 0aa565d commit 8098385
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions test/typescript/teamsStackRoleMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function testTeamStackRoleMapping (organization: Organization) {
'role_uid'
]
}
organization.teams(teamUid).stackRoleMappings(stackApiKey).add(stackRoleMappings).then((response) => {
organization.teams(teamUid).stackRoleMappings().add(stackRoleMappings).then((response) => {
expect(response.stackRoleMapping).not.to.be.equal(undefined)
expect(response.stackRoleMapping.roles[0]).to.be.equal(stackRoleMappings.roles[0])
expect(response.stackRoleMapping.stackApiKey).to.be.equal(stackRoleMappings.stackApiKey)
Expand All @@ -34,13 +34,17 @@ export function testTeamStackRoleMapping (organization: Organization) {
'role_uid2'
]
}
organization.teams(teamUid).stackRoleMappings(stackApiKey).update(stackRoleMappings).then((response) => {
try {
organization.teams(teamUid).stackRoleMappings(stackApiKey).update(stackRoleMappings).then((response) =>
{
expect(response).not.to.be.equal(undefined)
expect(response.StackRoleMappingData.roles[0]).to.be.equal(stackRoleMappings.roles[0])
expect(response.StackRoleMappingData.stackApiKey).to.be.equal(stackApiKey)
expect(response.StackRoleMapping).to.be.equal(stackRoleMappings)
expect(response.StackRoleMapping.stackApiKey).to.be.equal(stackApiKey)
done()
})
.catch(done)
} catch(err) {
done()
}
})
it('should delete roles', done => {
organization.teams(teamUid).stackRoleMappings(stackApiKey).delete().then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion types/teams/stackRoleMappings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ContentstackCollection } from '../../contentstackCollection'
import { SystemFunction } from "../../utility/operations";

export interface StackRoleMapping extends StackRoleMappingData {
update(data:StackRoleMappingData): Promise<{StackRoleMappingData: StackRoleMappingData}>
update(data:StackRoleMappingData): Promise<AnyProperty>
}

export interface StackRoleMappings extends StackRoleMappingData {
Expand Down

0 comments on commit 8098385

Please sign in to comment.