Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes missing alias to sp in some enterpriseapp commands. Closes #6476 #6477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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