Skip to content

Commit

Permalink
log content
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Nov 27, 2024
1 parent 32439ed commit 5cc8719
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ 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();

await command.execute(workspaceTreeItem);

console.log('showWarningMessageStub.calledOnce:', showWarningMessageStub.calledOnce);
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);

});
});

0 comments on commit 5cc8719

Please sign in to comment.