Skip to content

Commit

Permalink
check for disabled command before selectAndReveal (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenporras authored Dec 5, 2024
1 parent 5d7f198 commit 52d9588
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ public void testAsyncRenameHandlerEnablement() throws Exception {
try {
IFile file = TestUtils.createUniqueTestFile(project, "old");
final var editor = (ITextEditor) TestUtils.openEditor(file);
editor.selectAndReveal(1, 0);

ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
Command command = commandService.getCommand(IWorkbenchCommandConstants.FILE_RENAME);
assertFalse(command.isEnabled());

editor.selectAndReveal(1, 0);

waitForAndAssertCondition(3 * delay, () -> command.isEnabled());
assertTrue(command.isHandled());
Expand Down

0 comments on commit 52d9588

Please sign in to comment.