Add ability to create publish profile from project context (#23110)

* Ability to add publish profile from project context

* Add/update test + fix Build vs None addition to sqlproj file
This commit is contained in:
Sakshi Sharma
2023-05-15 16:14:07 -07:00
committed by GitHub
parent b56f2ccb60
commit b260edcec3
10 changed files with 64 additions and 6 deletions

View File

@@ -429,6 +429,19 @@ describe('ProjectsController', function (): void {
should(project.postDeployScripts.length).equal(1, 'Post deploy script should be successfully added');
});
it('Should be able to add publish profile', async function (): Promise<void> {
const publishProfileName = 'profile.publish.xml';
const projController = new ProjectsController(testContext.outputChannel);
const project = await testUtils.createTestProject(this.test, baselines.newProjectFileBaseline);
sinon.stub(vscode.window, 'showInputBox').resolves(publishProfileName);
sinon.stub(utils, 'sanitizeStringForFilename').returns(publishProfileName);
should(project.publishProfiles.length).equal(0, 'There should be no publish profiles');
await projController.addItemPrompt(project, '', { itemType: ItemType.publishProfile });
should(project.publishProfiles.length).equal(1, 'Publish profile should be successfully added.');
});
it('Should change target platform', async function (): Promise<void> {
sinon.stub(vscode.window, 'showQuickPick').resolves({ label: SqlTargetPlatform.sqlAzure });

View File

@@ -23,7 +23,7 @@ describe('Templates: loading templates from disk', function (): void {
// check expected counts
const numScriptObjectTypes = 10;
const numScriptObjectTypes = 11;
should(templates.projectScriptTypes().length).equal(numScriptObjectTypes);
should(Object.keys(templates.projectScriptTypes()).length).equal(numScriptObjectTypes);