Skip to content

Commit

Permalink
refined logs
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Nov 27, 2024
1 parent 5cc8719 commit f31a1ba
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"');
});
});

0 comments on commit f31a1ba

Please sign in to comment.