mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[mod-commands] ModOpenUrl command
GitOrigin-RevId: 164a69f1d570e08a8e7af108c24e6c3f312f405e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
86e193d79f
commit
edec77df83
@@ -3,6 +3,7 @@ package com.intellij.modcommand;
|
||||
|
||||
import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo;
|
||||
import com.intellij.openapi.fileTypes.UserBinaryFileType;
|
||||
import com.intellij.openapi.util.text.HtmlChunk;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
|
||||
@@ -25,4 +26,15 @@ public final class ModCommandTest extends LightPlatformCodeInsightTestCase {
|
||||
assertNotNull(child);
|
||||
assertOrderedEquals(content, child.contentsToByteArray());
|
||||
}
|
||||
|
||||
public void testBrowse() {
|
||||
configureFromFileText("dummy.txt", "");
|
||||
ActionContext context = ActionContext.from(null, getFile());
|
||||
ModCommand command = ModCommand.openUrl("https://example.com");
|
||||
ModCommandExecutor executor = ModCommandExecutor.getInstance();
|
||||
IntentionPreviewInfo preview = executor.getPreview(command, context);
|
||||
assertEquals(new IntentionPreviewInfo.Html(HtmlChunk.text("Browse \"https://example.com\"")), preview);
|
||||
ModCommandExecutor.BatchExecutionResult result = executor.executeInBatch(context, command);
|
||||
assertEquals(ModCommandExecutor.Result.INTERACTIVE, result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user