Removing ApiWrapper and adding sinon (#11340)

* Added sinon
removed api wrapper
removed unnecesaary utils

* merged from testfix

* merged from aasim/import/downloadTestFix

* merge from aasim/import/downloadTestFix
This commit is contained in:
Aasim Khan
2020-07-14 14:53:18 -07:00
committed by GitHub
parent cabbbb56f2
commit 24f6cd2e5b
19 changed files with 212 additions and 322 deletions

View File

@@ -5,14 +5,12 @@
import * as azdata from 'azdata';
import { ImportDataModel } from './models';
import { ApiWrapper } from '../../common/apiWrapper';
export abstract class BasePage {
protected readonly wizardPage: azdata.window.WizardPage;
protected readonly model: ImportDataModel;
protected readonly view: azdata.ModelView;
protected _apiWrapper: ApiWrapper;
/**
* This method constructs all the elements of the page.
@@ -45,7 +43,7 @@ export abstract class BasePage {
public abstract setupNavigationValidator(): void;
public async getServerValues(): Promise<{ connection: azdata.connection.Connection, displayName: string, name: string }[]> {
let cons = await this._apiWrapper.getActiveConnections();
let cons = await azdata.connection.getActiveConnections();
// This user has no active connections ABORT MISSION
if (!cons || cons.length === 0) {
return undefined;
@@ -95,7 +93,7 @@ export abstract class BasePage {
public async getDatabaseValues(): Promise<{ displayName: string, name: string }[]> {
let idx = -1;
let count = -1;
let values = (await this._apiWrapper.listDatabases(this.model.server.connectionId)).map(db => {
let values = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => {
count++;
if (this.model.database && db === this.model.database) {
idx = count;