-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4504b4e
commit c72eeb7
Showing
5 changed files
with
115 additions
and
146 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export interface Community { | ||
id: string; | ||
displayName: string; | ||
id?: string; | ||
displayName?: string; | ||
description?: string; | ||
privacy: string; | ||
groupId: string; | ||
privacy?: string; | ||
groupId?: string; | ||
} |
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 |
---|---|---|
|
@@ -37,26 +37,7 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
"userPrincipalName": "[email protected]" | ||
} | ||
]; | ||
const membersResult = [ | ||
{ | ||
"id": "1deb8814-8130-451d-8fcb-849dc7ed47e5", | ||
"businessPhones": [ | ||
"123-555-1215" | ||
], | ||
"displayName": "Samu Tolonen", | ||
"givenName": "Samu", | ||
"jobTitle": "IT Manager", | ||
"mail": null, | ||
"mobilePhone": "123-555-6645", | ||
"officeLocation": "123455", | ||
"preferredLanguage": null, | ||
"surname": "Tolonen", | ||
"userPrincipalName": "[email protected]", | ||
"roles": [ | ||
"Member" | ||
] | ||
} | ||
]; | ||
const membersResult = [{ ...membersAPIResult[0], roles: ["Member"] }]; | ||
const adminsAPIResult = [ | ||
{ | ||
"id": "da634de7-d23c-4419-ab83-fcd395b4ebd0", | ||
|
@@ -74,26 +55,13 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
"userPrincipalName": "[email protected]" | ||
} | ||
]; | ||
const adminsResult = [ | ||
{ | ||
"id": "da634de7-d23c-4419-ab83-fcd395b4ebd0", | ||
"businessPhones": [ | ||
"123-555-1215" | ||
], | ||
"displayName": "Anton Johansen", | ||
"givenName": "Anton", | ||
"jobTitle": "IT Manager", | ||
"mail": null, | ||
"mobilePhone": "123-555-6645", | ||
"officeLocation": "123455", | ||
"preferredLanguage": null, | ||
"surname": "Johansen", | ||
"userPrincipalName": "[email protected]", | ||
"roles": [ | ||
"Admin" | ||
] | ||
} | ||
]; | ||
const adminsResult = [{ ...adminsAPIResult[0], roles: ["Admin"] }]; | ||
const community = { | ||
id: communityId, | ||
displayName: communityDisplayName, | ||
privacy: 'Public', | ||
groupId: entraGroupId | ||
}; | ||
|
||
let log: string[]; | ||
let logger: Logger; | ||
|
@@ -130,7 +98,7 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
afterEach(() => { | ||
sinonUtil.restore([ | ||
request.get, | ||
vivaEngage.getEntraGroupIdByCommunityId | ||
vivaEngage.getCommunityById | ||
]); | ||
}); | ||
|
||
|
@@ -235,7 +203,7 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
throw 'Invalid request'; | ||
}); | ||
|
||
sinon.stub(vivaEngage, 'getEntraGroupIdByCommunityId').resolves(entraGroupId); | ||
sinon.stub(vivaEngage, 'getCommunityById').resolves(community); | ||
|
||
await command.action(logger, { options: { communityId: communityId, verbose: true } }); | ||
assert(loggerLogSpy.calledWith([...adminsResult, ...membersResult])); | ||
|
@@ -254,7 +222,7 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
throw 'Invalid request'; | ||
}); | ||
|
||
sinon.stub(vivaEngage, 'getEntraGroupIdByCommunityDisplayName').resolves(entraGroupId); | ||
sinon.stub(vivaEngage, 'getCommunityByDisplayName').resolves(community); | ||
|
||
await command.action(logger, { options: { communityDisplayName: communityDisplayName, verbose: true } }); | ||
assert(loggerLogSpy.calledWith([...adminsResult, ...membersResult])); | ||
|
@@ -290,7 +258,7 @@ describe(commands.ENGAGE_COMMUNITY_USER_LIST, () => { | |
throw 'Invalid request'; | ||
}); | ||
|
||
sinon.stub(vivaEngage, 'getEntraGroupIdByCommunityId').resolves(entraGroupId); | ||
sinon.stub(vivaEngage, 'getCommunityById').resolves(community); | ||
|
||
await command.action(logger, { options: { communityId: communityId, role: 'Admin' } }); | ||
assert(loggerLogSpy.calledWith(adminsResult)); | ||
|
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
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
Oops, something went wrong.