Skip to content

Commit

Permalink
Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
50Wliu committed Jan 2, 2022
1 parent 1ab4d32 commit edddf2d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/integrationTests/codeActionRename.integration.test.ts
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 edddf2d

Please sign in to comment.