Skip to content

Commit

Permalink
Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
winstliu committed Jan 3, 2022
1 parent ffdb9c1 commit 1b7d018
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/integrationTests/codeActionRename.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ suite(`Code Action Rename ${testAssetWorkspace.description}`, function () {

test("Code actions can rename and open files", async () => {
await vscode.commands.executeCommand("vscode.open", fileUri);
let c = await vscode.commands.executeCommand("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7)) as { command: string, title: string, arguments: string[] }[];
let command = c.find(
(s) => { return s.title == "Rename file to C.cs"; }
);
expect(command, "Didn't find rename class command");
const codeActions = await vscode.commands.executeCommand<vscode.CodeAction[]>("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7));
const codeAction = codeActions.find(codeAction => codeAction.title == "Rename file to C.cs");
expect(codeAction, "Didn't find rename class code action");

await vscode.commands.executeCommand(command.command, ...command.arguments);
await vscode.commands.executeCommand(codeAction.command.command, ...codeAction.command.arguments);

await assertWithPoll(() => { }, 15 * 1000, 500, _ => expect(vscode.window.activeTextEditor.document.fileName).contains("C.cs"));
});
Expand Down

0 comments on commit 1b7d018

Please sign in to comment.