From f31a1ba57e9821a3579e5c2af085a4b88c2803e6 Mon Sep 17 00:00:00 2001 From: thewahome Date: Wed, 27 Nov 2024 11:18:44 +0300 Subject: [PATCH] refined logs --- .../suite/commands/deleteWorkspaceItemCommand.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 090ca601ad..9a5763000d 100644 --- a/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts +++ b/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts @@ -27,10 +27,8 @@ suite('DeleteWorkspaceItemCommand Tests', () => { }); test('execute should show success message and refresh workspace on success', async () => { - // Create MessageItem objects const yesAnswer: vscode.MessageItem = { title: vscode.l10n.t("Yes") }; - // Mock the showWarningMessage method const showWarningMessageStub = sinon.stub(vscode.window, 'showWarningMessage').resolves(yesAnswer); const showInformationMessageStub = sinon.stub(vscode.window, 'showInformationMessage').resolves(); const executeCommandStub = sinon.stub(vscode.commands, 'executeCommand').resolves(); @@ -41,8 +39,8 @@ suite('DeleteWorkspaceItemCommand Tests', () => { console.log('showInformationMessageStub.calledOnce:', showInformationMessageStub.calledOnce); console.log('executeCommandStub.calledWith("kiota.workspace.refresh"):', executeCommandStub.calledWith('kiota.workspace.refresh')); - assert.strictEqual(showWarningMessageStub.calledOnce, true); - assert.strictEqual(showInformationMessageStub.calledOnce, true); - assert.strictEqual(executeCommandStub.calledWith('kiota.workspace.refresh'), true); + assert.strictEqual(showWarningMessageStub.calledOnce, true, 'showWarningMessage was not called once'); + assert.strictEqual(showInformationMessageStub.calledOnce, true, 'showInformationMessage was not called once'); + assert.strictEqual(executeCommandStub.calledWith('kiota.workspace.refresh'), true, 'executeCommand was not called with "kiota.workspace.refresh"'); }); }); \ No newline at end of file