mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add a few dacpac extension tests (#10322)
* add controller test * Add a few wizard tests * Addressing comment * fix compile error
This commit is contained in:
@@ -7,10 +7,16 @@ import 'mocha';
|
||||
import * as should from 'should';
|
||||
import * as loc from '../localizedConstants';
|
||||
import { DataTierApplicationWizard, Operation } from '../wizard/dataTierApplicationWizard';
|
||||
import { DacFxDataModel } from '../wizard/api/models';
|
||||
|
||||
let wizard: DataTierApplicationWizard;
|
||||
describe('Dacfx wizard', function (): void {
|
||||
beforeEach(async function (): Promise<void> {
|
||||
wizard = new DataTierApplicationWizard();
|
||||
wizard.model = <DacFxDataModel>{};
|
||||
});
|
||||
|
||||
it('Should initialize wizard correctly', async () => {
|
||||
let wizard = new DataTierApplicationWizard();
|
||||
should.notEqual(wizard.wizard, undefined);
|
||||
should.equal(wizard.wizard.title, loc.wizardTitle);
|
||||
|
||||
@@ -18,8 +24,50 @@ describe('Dacfx wizard', function (): void {
|
||||
should.notEqual(wizard.pages, undefined);
|
||||
should.equal(wizard.pages.size, 7);
|
||||
should.equal(wizard.wizard.pages.length, 4);
|
||||
});
|
||||
|
||||
it('Should determine summary page correctly', async () => {
|
||||
// summary page should be 2 for deploy
|
||||
wizard.selectedOperation = Operation.deploy;
|
||||
wizard.model.upgradeExisting = false;
|
||||
should.equal(wizard.isSummaryPage(2), true);
|
||||
|
||||
// summary page should be 3 for deploy - upgrade existing db
|
||||
wizard.selectedOperation = Operation.deploy;
|
||||
wizard.model.upgradeExisting = true;
|
||||
should.equal(wizard.isSummaryPage(3), true);
|
||||
|
||||
// summary page should be 3 for generate deploy script
|
||||
wizard.selectedOperation = Operation.generateDeployScript;
|
||||
should.equal(wizard.isSummaryPage(3), true);
|
||||
|
||||
// summary page should be 2 for import
|
||||
wizard.selectedOperation = Operation.import;
|
||||
should.equal(wizard.isSummaryPage(2), true);
|
||||
|
||||
// summary page should be 2 for export
|
||||
wizard.selectedOperation = Operation.export;
|
||||
should.equal(wizard.isSummaryPage(2), true);
|
||||
|
||||
// summary page should be 2 for extract
|
||||
wizard.selectedOperation = Operation.extract;
|
||||
should.equal(wizard.isSummaryPage(2), true);
|
||||
});
|
||||
|
||||
it('Should set Done button and operation correctly', async () => {
|
||||
wizard.setDoneButton(Operation.deploy);
|
||||
should.equal(wizard.selectedOperation, Operation.deploy);
|
||||
|
||||
wizard.setDoneButton(Operation.generateDeployScript);
|
||||
should.equal(wizard.selectedOperation, Operation.generateDeployScript);
|
||||
|
||||
wizard.setDoneButton(Operation.extract);
|
||||
should.equal(wizard.selectedOperation, Operation.extract);
|
||||
|
||||
wizard.setDoneButton(Operation.import);
|
||||
should.equal(wizard.selectedOperation, Operation.import);
|
||||
|
||||
wizard.setDoneButton(Operation.export);
|
||||
should.equal(wizard.selectedOperation, Operation.export);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user