Delete account (#1285)
* Delete account * Update code according to comments
This commit is contained in:
Родитель
9a293eab09
Коммит
831536c561
|
@ -80,7 +80,7 @@ suite('MongoDB action', async function (this: ISuiteCallbackContext): Promise<vo
|
|||
assert.ifError(mongoDatabase);
|
||||
});
|
||||
|
||||
test('Delete account', async () => {
|
||||
test('Delete Mongo account', async () => {
|
||||
const mongoAccount: CosmosDBManagementModels.DatabaseAccount = await client.databaseAccounts.get(resourceGroupName, accountName);
|
||||
assert.ok(mongoAccount);
|
||||
const testInputs: string[] = [`${accountName} (MongoDB)`, DialogResponses.deleteResponse.title];
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||
import { CosmosDBManagementModels } from 'azure-arm-cosmosdb';
|
||||
import { IHookCallbackContext, ISuiteCallbackContext } from 'mocha';
|
||||
import * as vscode from 'vscode';
|
||||
import { randomUtils } from '../../extension.bundle';
|
||||
import { randomUtils, DialogResponses } from '../../extension.bundle';
|
||||
import { longRunningTestsEnabled, testUserInput } from '../global.test';
|
||||
import { resourceGroupsToDelete, client } from './global.resource.test';
|
||||
|
||||
|
@ -35,4 +35,16 @@ suite('SQL action', async function (this: ISuiteCallbackContext): Promise<void>
|
|||
const getAccount: CosmosDBManagementModels.DatabaseAccount | undefined = await client.databaseAccounts.get(resourceGroupName, accountName);
|
||||
assert.ok(getAccount);
|
||||
});
|
||||
|
||||
test('Delete SQL account', async () => {
|
||||
const SQLAccount: CosmosDBManagementModels.DatabaseAccount = await client.databaseAccounts.get(resourceGroupName, accountName);
|
||||
assert.ok(SQLAccount);
|
||||
const testInputs: string[] = [`${accountName} (SQL)`, DialogResponses.deleteResponse.title];
|
||||
await testUserInput.runWithInputs(testInputs, async () => {
|
||||
await vscode.commands.executeCommand('cosmosDB.deleteAccount');
|
||||
});
|
||||
const listAccounts: CosmosDBManagementModels.DatabaseAccountsListResult = await client.databaseAccounts.listByResourceGroup(resourceGroupName);
|
||||
const accountExists: CosmosDBManagementModels.DatabaseAccount | undefined = listAccounts.find((account: CosmosDBManagementModels.DatabaseAccount) => account.name === accountName);
|
||||
assert.ifError(accountExists);
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче