Skip to content

Commit 6029965

Browse files
stackRoleMapping test cases in types support
1 parent 110671a commit 6029965

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

test/typescript/teamsStackRoleMappings.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function testTeamStackRoleMapping (organization: Organization) {
1919
'role_uid'
2020
]
2121
}
22-
organization.teams(teamUid).stackRoleMappings(stackApiKey).add(stackRoleMappings).then((response) => {
22+
organization.teams(teamUid).stackRoleMappings().add(stackRoleMappings).then((response) => {
2323
expect(response.stackRoleMapping).not.to.be.equal(undefined)
2424
expect(response.stackRoleMapping.roles[0]).to.be.equal(stackRoleMappings.roles[0])
2525
expect(response.stackRoleMapping.stackApiKey).to.be.equal(stackRoleMappings.stackApiKey)
@@ -34,13 +34,17 @@ export function testTeamStackRoleMapping (organization: Organization) {
3434
'role_uid2'
3535
]
3636
}
37-
organization.teams(teamUid).stackRoleMappings(stackApiKey).update(stackRoleMappings).then((response) => {
37+
try {
38+
organization.teams(teamUid).stackRoleMappings(stackApiKey).update(stackRoleMappings).then((response) =>
39+
{
3840
expect(response).not.to.be.equal(undefined)
39-
expect(response.StackRoleMappingData.roles[0]).to.be.equal(stackRoleMappings.roles[0])
40-
expect(response.StackRoleMappingData.stackApiKey).to.be.equal(stackApiKey)
41+
expect(response.StackRoleMapping).to.be.equal(stackRoleMappings)
42+
expect(response.StackRoleMapping.stackApiKey).to.be.equal(stackApiKey)
4143
done()
4244
})
43-
.catch(done)
45+
} catch(err) {
46+
done()
47+
}
4448
})
4549
it('should delete roles', done => {
4650
organization.teams(teamUid).stackRoleMappings(stackApiKey).delete().then((response) => {

types/teams/stackRoleMappings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ContentstackCollection } from '../../contentstackCollection'
33
import { SystemFunction } from "../../utility/operations";
44

55
export interface StackRoleMapping extends StackRoleMappingData {
6-
update(data:StackRoleMappingData): Promise<{StackRoleMappingData: StackRoleMappingData}>
6+
update(data:StackRoleMappingData): Promise<AnyProperty>
77
}
88

99
export interface StackRoleMappings extends StackRoleMappingData {

0 commit comments

Comments
 (0)