From c7252b35024f44a2d18de0edf1cd2eed7bfee5b7 Mon Sep 17 00:00:00 2001 From: Aaron Junker Date: Thu, 19 Oct 2023 11:14:46 +0200 Subject: [PATCH] Fix missed tests and docs sidebar --- .eslintrc.cjs | 2 +- docs/src/config/sidebars.js | 254 +++++++++++----------- src/index.spec.ts | 4 +- src/m365/cli/commands/cli-consent.spec.ts | 12 +- 4 files changed, 134 insertions(+), 138 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3137e992727..e49971c64ce 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -228,7 +228,7 @@ module.exports = { }, { "files": [ - "**/yammer/**" + "**/viva/**" ], "rules": { "camelcase": "off" diff --git a/docs/src/config/sidebars.js b/docs/src/config/sidebars.js index 28f8a409d37..1a944cbacc8 100644 --- a/docs/src/config/sidebars.js +++ b/docs/src/config/sidebars.js @@ -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' + } + ] } ] } diff --git a/src/index.spec.ts b/src/index.spec.ts index cae2a4a0a4b..57710b1410a 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -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)); @@ -40,8 +39,7 @@ describe('Lazy loading commands', () => { spoCommands.default, teamsCommands.default, tenantCommands.default, - utilCommands.default, - yammerCommands.default + utilCommands.default ]; const aliases: string[] = [ 'consent', diff --git a/src/m365/cli/commands/cli-consent.spec.ts b/src/m365/cli/commands/cli-consent.spec.ts index 45f387c56de..8f55b2942ca 100644 --- a/src/m365/cli/commands/cli-consent.spec.ts +++ b/src/m365/cli/commands/cli-consent.spec.ts @@ -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', () => { @@ -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); }); });