Fix default auth and 'AzureTenantId' to persist and not reset on selection event (#21289)

This commit is contained in:
Cheena Malhotra
2022-11-23 17:39:03 -08:00
committed by GitHub
parent 86c3f315f2
commit 405b3bbfdb
11 changed files with 24 additions and 20 deletions

View File

@@ -164,6 +164,9 @@ describe('AzureResourceDatabaseTreeDataProvider.getChildren', function (): void
should(child.treeItem.label).equal(`${database.name} (${database.serverName})`);
should(child.treeItem.collapsibleState).equal(vscode.TreeItemCollapsibleState.Collapsed);
should(child.treeItem.contextValue).equal(AzureResourceItemType.database);
// Authentication type should be empty string by default to support setting 'Sql: Default Authentication Type'.
should(child.treeItem.payload!.authenticationType).equal('');
}
});
});

View File

@@ -163,6 +163,9 @@ describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function ():
should(child.treeItem.label).equal(databaseServer.name);
should(child.treeItem.collapsibleState).equal(vscode.TreeItemCollapsibleState.Collapsed);
should(child.treeItem.contextValue).equal(AzureResourceItemType.databaseServer);
// Authentication type should be empty string by default to support setting 'Sql: Default Authentication Type'.
should(child.treeItem.payload!.authenticationType).equal('');
}
});
});

View File

@@ -106,7 +106,7 @@ describe('AzureResourceService.getRootChildren', function (): void {
});
it('Should be correct when provider id is correct.', async function (): Promise<void> {
const children = await resourceService.getRootChildren(mockResourceProvider1.object.providerId, mockAccount, mockSubscription, mockTenantId);
const children = await resourceService.getRootChildren(mockResourceProvider1.object.providerId, mockAccount, mockSubscription);
should(children).Array();
});
@@ -114,7 +114,7 @@ describe('AzureResourceService.getRootChildren', function (): void {
it('Should throw exceptions when provider id is incorrect.', async function (): Promise<void> {
const providerId = 'non_existent_provider_id';
try {
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription, mockTenantId);
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription);
} catch (error) {
should(error.message).equal(`Azure resource provider doesn't exist. Id: ${providerId}`);
return;
@@ -147,7 +147,7 @@ describe('AzureResourceService.getChildren', function (): void {
it('Should throw exceptions when provider id is incorrect.', async function (): Promise<void> {
const providerId = 'non_existent_provider_id';
try {
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription, mockTenantId);
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription);
} catch (error) {
should(error.message).equal(`Azure resource provider doesn't exist. Id: ${providerId}`);
return;
@@ -180,7 +180,7 @@ describe('AzureResourceService.getTreeItem', function (): void {
it('Should throw exceptions when provider id is incorrect.', async function (): Promise<void> {
const providerId = 'non_existent_provider_id';
try {
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription, mockTenantId);
await resourceService.getRootChildren(providerId, mockAccount, mockSubscription);
} catch (error) {
should(error.message).equal(`Azure resource provider doesn't exist. Id: ${providerId}`);
return;