mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
cleanup dacpac and schema compare to use createConnectionProfile() from ads-test (#19942)
* cleanup dacpac and schema compare to use createConnectionProfile() from ads-test * typo * reuse mockConnectionInfo
This commit is contained in:
@@ -10,12 +10,12 @@ import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as azdataTest from '@microsoft/azdata-test';
|
||||
|
||||
import { DataTierApplicationWizard, PageName } from '../wizard/dataTierApplicationWizard';
|
||||
import { DacFxDataModel } from '../wizard/api/models';
|
||||
import { TestContext, createContext } from './testContext';
|
||||
import { TestDeployConfigPage, TestExtractConfigPage, TestImportConfigPage } from './testDacFxConfigPages';
|
||||
import { mockConnectionProfile } from './testUtils';
|
||||
|
||||
let wizard: DataTierApplicationWizard;
|
||||
let testContext: TestContext;
|
||||
@@ -92,7 +92,7 @@ describe('Dacfx Wizard Pages', function (): void {
|
||||
testContext = createContext();
|
||||
wizard.setPages();
|
||||
|
||||
sinon.stub(azdata.connection, 'getConnections').resolves([mockConnectionProfile]);
|
||||
sinon.stub(azdata.connection, 'getConnections').resolves([azdataTest.stubs.connectionProfile.createConnectionProfile()]);
|
||||
sinon.stub(azdata.connection, 'listDatabases').resolves(['fakeDatabaseName']);
|
||||
sinon.stub(vscode.window, 'showOpenDialog').resolves([vscode.Uri.file(dacpacPath)]);
|
||||
|
||||
@@ -112,7 +112,7 @@ describe('Dacfx Wizard Pages', function (): void {
|
||||
testContext = createContext();
|
||||
wizard.setPages();
|
||||
|
||||
sinon.stub(azdata.connection, 'getConnections').resolves([mockConnectionProfile]);
|
||||
sinon.stub(azdata.connection, 'getConnections').resolves([azdataTest.stubs.connectionProfile.createConnectionProfile()]);
|
||||
sinon.stub(azdata.connection, 'listDatabases').resolves(['fakeDatabaseName', 'master', 'msdb', 'tempdb', 'model']);
|
||||
|
||||
let extractConfigPage = new TestExtractConfigPage(wizard, wizard.pages.get(PageName.deployConfig).wizardPage, wizard.model, testContext.viewContext.view);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export const mockConnectionProfile: azdata.connection.ConnectionProfile = {
|
||||
providerId: 'MSSQL',
|
||||
connectionId: 'My Connection ID',
|
||||
connectionName: 'My Connection',
|
||||
serverName: 'My Server',
|
||||
databaseName: 'My Database',
|
||||
userName: 'My User',
|
||||
password: 'My Pwd',
|
||||
authenticationType: 'SqlLogin',
|
||||
savePassword: false,
|
||||
groupFullName: 'My groupName',
|
||||
groupId: 'My GroupId',
|
||||
saveProfile: true,
|
||||
options: {}
|
||||
};
|
||||
Reference in New Issue
Block a user