Skip to content

Commit

Permalink
Fix missed tests and docs sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-Junker committed Oct 19, 2023
1 parent 0abdc37 commit c7252b3
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ module.exports = {
},
{
"files": [
"**/yammer/**"
"**/viva/**"
],
"rules": {
"camelcase": "off"
Expand Down
254 changes: 126 additions & 128 deletions docs/src/config/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -4049,134 +4049,132 @@ const sidebars = {
label: 'connections app create',
id: 'cmd/viva/connections/connections-app-create'
}
]
}
]
},
{
'Yammer (yammer)': [
{
type: 'doc',
label: 'search',
id: 'cmd/yammer/yammer-search'
},
{
group: [
{
type: 'doc',
label: 'group list',
id: 'cmd/yammer/group/group-list'
},
{
type: 'doc',
label: 'group user add',
id: 'cmd/yammer/group/group-user-add'
},
{
type: 'doc',
label: 'group user remove',
id: 'cmd/yammer/group/group-user-remove'
}
]
},
{
message: [
{
type: 'doc',
label: 'message add',
id: 'cmd/yammer/message/message-add'
},
{
type: 'doc',
label: 'message get',
id: 'cmd/yammer/message/message-get'
},
{
type: 'doc',
label: 'message list',
id: 'cmd/yammer/message/message-list'
},
{
type: 'doc',
label: 'message remove',
id: 'cmd/yammer/message/message-remove'
},
{
type: 'doc',
label: 'message like set',
id: 'cmd/yammer/message/message-like-set'
}
]
},
{
network: [
{
type: 'doc',
label: 'network list',
id: 'cmd/yammer/network/network-list'
}
]
},
{
report: [
{
type: 'doc',
label: 'report activitycounts',
id: 'cmd/yammer/report/report-activitycounts'
},
{
type: 'doc',
label: 'report activityusercounts',
id: 'cmd/yammer/report/report-activityusercounts'
},
{
type: 'doc',
label: 'report activityuserdetail',
id: 'cmd/yammer/report/report-activityuserdetail'
},
{
type: 'doc',
label: 'report deviceusagedistributionusercounts',
id: 'cmd/yammer/report/report-deviceusagedistributionusercounts'
},
{
type: 'doc',
label: 'report deviceusageusercounts',
id: 'cmd/yammer/report/report-deviceusageusercounts'
},
{
type: 'doc',
label: 'report deviceusageuserdetail',
id: 'cmd/yammer/report/report-deviceusageuserdetail'
},
{
type: 'doc',
label: 'report groupsactivitycounts',
id: 'cmd/yammer/report/report-groupsactivitycounts'
},
{
type: 'doc',
label: 'report groupsactivitydetail',
id: 'cmd/yammer/report/report-groupsactivitydetail'
},
{
type: 'doc',
label: 'report groupsactivitygroupcounts',
id: 'cmd/yammer/report/report-groupsactivitygroupcounts'
}
]
},
{
user: [
{
type: 'doc',
label: 'user get',
id: 'cmd/yammer/user/user-get'
},
{
type: 'doc',
label: 'user list',
id: 'cmd/yammer/user/user-list'
],
engage: [
{
type: 'doc',
label: 'search',
id: 'cmd/yammer/yammer-search'
},
{
group: [
{
type: 'doc',
label: 'group list',
id: 'cmd/yammer/group/group-list'
},
{
type: 'doc',
label: 'group user add',
id: 'cmd/yammer/group/group-user-add'
},
{
type: 'doc',
label: 'group user remove',
id: 'cmd/yammer/group/group-user-remove'
}
]
},
{
message: [
{
type: 'doc',
label: 'message add',
id: 'cmd/yammer/message/message-add'
},
{
type: 'doc',
label: 'message get',
id: 'cmd/yammer/message/message-get'
},
{
type: 'doc',
label: 'message list',
id: 'cmd/yammer/message/message-list'
},
{
type: 'doc',
label: 'message remove',
id: 'cmd/yammer/message/message-remove'
},
{
type: 'doc',
label: 'message like set',
id: 'cmd/yammer/message/message-like-set'
}
]
},
{
network: [
{
type: 'doc',
label: 'network list',
id: 'cmd/yammer/network/network-list'
}
]
},
{
report: [
{
type: 'doc',
label: 'report activitycounts',
id: 'cmd/yammer/report/report-activitycounts'
},
{
type: 'doc',
label: 'report activityusercounts',
id: 'cmd/yammer/report/report-activityusercounts'
},
{
type: 'doc',
label: 'report activityuserdetail',
id: 'cmd/yammer/report/report-activityuserdetail'
},
{
type: 'doc',
label: 'report deviceusagedistributionusercounts',
id: 'cmd/yammer/report/report-deviceusagedistributionusercounts'
},
{
type: 'doc',
label: 'report deviceusageusercounts',
id: 'cmd/yammer/report/report-deviceusageusercounts'
},
{
type: 'doc',
label: 'report deviceusageuserdetail',
id: 'cmd/yammer/report/report-deviceusageuserdetail'
},
{
type: 'doc',
label: 'report groupsactivitycounts',
id: 'cmd/yammer/report/report-groupsactivitycounts'
},
{
type: 'doc',
label: 'report groupsactivitydetail',
id: 'cmd/yammer/report/report-groupsactivitydetail'
},
{
type: 'doc',
label: 'report groupsactivitygroupcounts',
id: 'cmd/yammer/report/report-groupsactivitygroupcounts'
}
]
},
{
user: [
{
type: 'doc',
label: 'user get',
id: 'cmd/yammer/user/user-get'
},
{
type: 'doc',
label: 'user list',
id: 'cmd/yammer/user/user-list'
}
]
}
]
}
Expand Down
4 changes: 1 addition & 3 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import * as spoCommands from './m365/spo/commands.js';
import * as teamsCommands from './m365/teams/commands.js';
import * as tenantCommands from './m365/tenant/commands.js';
import * as utilCommands from './m365/util/commands.js';
import * as yammerCommands from './m365/yammer/commands.js';

const __dirname = url.fileURLToPath(new URL('.', import.meta.url));

Expand All @@ -40,8 +39,7 @@ describe('Lazy loading commands', () => {
spoCommands.default,
teamsCommands.default,
tenantCommands.default,
utilCommands.default,
yammerCommands.default
utilCommands.default
];
const aliases: string[] = [
'consent',
Expand Down
12 changes: 6 additions & 6 deletions src/m365/cli/commands/cli-consent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ describe(commands.CONSENT, () => {
});

it('shows consent URL for Viva Engage permissions for the default multi-tenant app', async () => {
await command.action(logger, { options: { service: 'yammer' } });
assert(loggerLogSpy.calledWith(`To consent permissions for executing Viva Engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation`));
await command.action(logger, { options: { service: 'viva engage' } });
assert(loggerLogSpy.calledWith(`To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation`));
});

it('shows consent URL for Viva Engage permissions for a custom single-tenant app', async () => {
config.tenant = 'fb5cb38f-ecdb-4c6a-a93b-b8cfd56b4a89';
config.cliAadAppId = '2587b55d-a41e-436d-bb1d-6223eb185dd4';
await command.action(logger, { options: { service: 'yammer' } });
assert(loggerLogSpy.calledWith(`To consent permissions for executing Viva Engage commands, navigate in your web browser to https://login.microsoftonline.com/fb5cb38f-ecdb-4c6a-a93b-b8cfd56b4a89/oauth2/v2.0/authorize?client_id=2587b55d-a41e-436d-bb1d-6223eb185dd4&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation`));
await command.action(logger, { options: { service: 'viva engage' } });
assert(loggerLogSpy.calledWith(`To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/fb5cb38f-ecdb-4c6a-a93b-b8cfd56b4a89/oauth2/v2.0/authorize?client_id=2587b55d-a41e-436d-bb1d-6223eb185dd4&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation`));
});

it('supports specifying service', () => {
Expand All @@ -88,8 +88,8 @@ describe(commands.CONSENT, () => {
assert.notStrictEqual(actual, true);
});

it('passes validation if service is set to yammer ', async () => {
const actual = await command.validate({ options: { service: 'yammer' } }, commandInfo);
it('passes validation if service is set to "viva engage" ', async () => {
const actual = await command.validate({ options: { service: 'viva engage' } }, commandInfo);
assert.strictEqual(actual, true);
});
});

0 comments on commit c7252b3

Please sign in to comment.