mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add DacFx summary page tests (#11519)
* remove generate script operation * add tests for summary page * add a couple more checks
This commit is contained in:
@@ -13,6 +13,7 @@ export class DacFxSummaryPage extends BasePage {
|
||||
private form: azdata.FormContainer;
|
||||
private table: azdata.TableComponent;
|
||||
private loader: azdata.LoadingComponent;
|
||||
public data: string[][];
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
@@ -36,7 +37,7 @@ export class DacFxSummaryPage extends BasePage {
|
||||
}
|
||||
|
||||
async onPageEnter(): Promise<boolean> {
|
||||
this.populateTable();
|
||||
await this.populateTable();
|
||||
this.loader.loading = false;
|
||||
if (this.model.upgradeExisting && this.instance.selectedOperation === Operation.deploy) {
|
||||
this.instance.wizard.generateScriptButton.hidden = false;
|
||||
@@ -61,8 +62,7 @@ export class DacFxSummaryPage extends BasePage {
|
||||
});
|
||||
}
|
||||
|
||||
private populateTable() {
|
||||
let data = [];
|
||||
private async populateTable(): Promise<void> {
|
||||
let targetServer = loc.targetServer;
|
||||
let targetDatabase = loc.targetDatabase;
|
||||
let sourceServer = loc.sourceServer;
|
||||
@@ -71,14 +71,14 @@ export class DacFxSummaryPage extends BasePage {
|
||||
|
||||
switch (this.instance.selectedOperation) {
|
||||
case Operation.deploy: {
|
||||
data = [
|
||||
this.data = [
|
||||
[targetServer, this.model.serverName],
|
||||
[fileLocation, this.model.filePath],
|
||||
[targetDatabase, this.model.database]];
|
||||
break;
|
||||
}
|
||||
case Operation.extract: {
|
||||
data = [
|
||||
this.data = [
|
||||
[sourceServer, this.model.serverName],
|
||||
[sourceDatabase, this.model.database],
|
||||
[loc.version, this.model.version],
|
||||
@@ -86,30 +86,23 @@ export class DacFxSummaryPage extends BasePage {
|
||||
break;
|
||||
}
|
||||
case Operation.import: {
|
||||
data = [
|
||||
this.data = [
|
||||
[targetServer, this.model.serverName],
|
||||
[fileLocation, this.model.filePath],
|
||||
[targetDatabase, this.model.database]];
|
||||
break;
|
||||
}
|
||||
case Operation.export: {
|
||||
data = [
|
||||
this.data = [
|
||||
[sourceServer, this.model.serverName],
|
||||
[sourceDatabase, this.model.database],
|
||||
[fileLocation, this.model.filePath]];
|
||||
break;
|
||||
}
|
||||
case Operation.generateDeployScript: {
|
||||
data = [
|
||||
[targetServer, this.model.serverName],
|
||||
[fileLocation, this.model.filePath],
|
||||
[targetDatabase, this.model.database]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.table.updateProperties({
|
||||
data: data,
|
||||
await this.table.updateProperties({
|
||||
data: this.data,
|
||||
columns: [
|
||||
{
|
||||
value: loc.setting,
|
||||
|
||||
Reference in New Issue
Block a user