Remove system dbs from dacfx wizard dropdowns (#11510)

* remove system dbs from dacfx wizard dropdowns

* add test for filtering out system dbs
This commit is contained in:
Kim Santiago
2020-07-30 13:52:05 -07:00
committed by GitHub
parent 6fbb9c2773
commit 5fd9d1b18f
2 changed files with 27 additions and 7 deletions

View File

@@ -107,6 +107,21 @@ describe('Dacfx Wizard Pages', function (): void {
should(importConfigPage.Model.filePath).equal(dacpacPath);
should(importConfigPage.Model.database).equal('myDatabase');
});
it('Should filter out system dbs', async () => {
testContext = createContext();
wizard.setPages();
sinon.stub(azdata.connection, 'getConnections').resolves([mockConnectionProfile]);
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);
await extractConfigPage.start();
await extractConfigPage.onPageEnter();
should(extractConfigPage.databaseValues.length).equal(1);
should(extractConfigPage.databaseValues[0]).equal('fakeDatabaseName');
});
});