mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
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:
@@ -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;
|
||||
|
||||
@@ -8,7 +8,6 @@ import * as azdata from 'azdata';
|
||||
import { FlatFileProvider } from '../../services/contracts';
|
||||
import { FlatFileWizard } from '../flatFileWizard';
|
||||
import { BasePage } from './basePage';
|
||||
import { ApiWrapper } from '../../common/apiWrapper';
|
||||
|
||||
export abstract class ImportPage extends BasePage {
|
||||
|
||||
@@ -19,13 +18,12 @@ export abstract class ImportPage extends BasePage {
|
||||
protected readonly provider: FlatFileProvider;
|
||||
|
||||
|
||||
constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider, apiWrapper: ApiWrapper) {
|
||||
constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super();
|
||||
this.instance = instance;
|
||||
this.wizardPage = wizardPage;
|
||||
this.model = model;
|
||||
this.view = view;
|
||||
this.provider = provider;
|
||||
this._apiWrapper = apiWrapper;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user