diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts index 3136fc3ab2..7a42ac0c74 100644 --- a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts @@ -24,7 +24,7 @@ export class DeleteWorkspaceItemCommand extends Command { public async execute(workspaceTreeItem: WorkspaceTreeItem): Promise { const type = workspaceTreeItem.category && isPluginType(workspaceTreeItem.category) ? "plugin" : "client"; const yesAnswer = vscode.l10n.t("Yes"); - const response = await vscode.window.showInformationMessage( + const response = await vscode.window.showWarningMessage( vscode.l10n.t("Do you want to delete this item?"), yesAnswer, vscode.l10n.t("No") diff --git a/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts b/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts index 93fc1dabba..70be3fdca4 100644 --- a/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts +++ b/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts @@ -28,12 +28,14 @@ suite('DeleteWorkspaceItemCommand Tests', () => { test('execute should show success message and refresh workspace on success', async () => { const deleteItemStub = sinon.stub(command as any, 'deleteItem').resolves([{ message: 'removed successfully' }]); + const showWarningMessageStub = sinon.stub(vscode.window, 'showWarningMessage').resolves({ title: "Yes" }); const showInformationMessageStub = sinon.stub(vscode.window, 'showInformationMessage').resolves(); const executeCommandStub = sinon.stub(vscode.commands, 'executeCommand').resolves(); await command.execute(workspaceTreeItem); assert.strictEqual(deleteItemStub.calledOnce, true); + assert.strictEqual(showWarningMessageStub.calledOnceWith("Do you want to delete this item?", sinon.match("Yes"), sinon.match("No")), true); assert.strictEqual(showInformationMessageStub.calledOnceWith('test-item removed successfully.'), true); assert.strictEqual(executeCommandStub.calledOnceWith('kiota.workspace.refresh'), true); });