Skip to content

Commit

Permalink
Fixes missing 'sp' alias in 'enterpriseapp' commands. Closes pnp#6476
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-it authored and martinlingstuyl committed Nov 8, 2024
1 parent 10765f6 commit 30bdb61
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ describe(commands.ENTERPRISEAPP_ADD, () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.SP_ADD]);
});

it('fails validation if neither the id, displayName, nor objectId option specified', async () => {
sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => {
if (settingName === settingsNames.prompt) {
Expand Down
4 changes: 4 additions & 0 deletions src/m365/entra/commands/enterpriseapp/enterpriseapp-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class EntraEnterpriseAppAddCommand extends GraphCommand {
return 'Creates an enterprise application (or service principal) for a registered Entra app';
}

public alias(): string[] | undefined {
return [commands.SP_ADD];
}

constructor() {
super();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ describe(commands.ENTERPRISEAPP_GET, () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.SP_GET]);
});

it('retrieves information about the specified enterprise application using its display name', async () => {
sinon.stub(request, 'get').callsFake(async (opts) => {
if ((opts.url as string).indexOf(`/v1.0/servicePrincipals?$filter=displayName eq `) > -1) {
Expand Down
4 changes: 4 additions & 0 deletions src/m365/entra/commands/enterpriseapp/enterpriseapp-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class EntraEnterpriseAppGetCommand extends GraphCommand {
return 'Gets information about an Enterprise Application';
}

public alias(): string[] | undefined {
return [commands.SP_GET];
}

constructor() {
super();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ describe(commands.ENTERPRISEAPP_LIST, () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.SP_LIST]);
});

it('defines correct properties for the default output', () => {
assert.deepStrictEqual(command.defaultProperties(), ['appId', 'displayName', 'tag']);
});
Expand Down
4 changes: 4 additions & 0 deletions src/m365/entra/commands/enterpriseapp/enterpriseapp-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class EntraEnterpriseAppListCommand extends GraphCommand {
return 'Lists the enterprise applications (or service principals) in Entra ID';
}

public alias(): string[] | undefined {
return [commands.SP_LIST];
}

constructor() {
super();

Expand Down

0 comments on commit 30bdb61

Please sign in to comment.