From fdec3dbefa5c522a81dbea187a258a0f5d0bdd39 Mon Sep 17 00:00:00 2001 From: Dmitry Drobotov Date: Mon, 13 Oct 2025 11:38:22 +0200 Subject: [PATCH] IJPL-210789 Implement a test that ExtendableTextField extensions can be used without Application GitOrigin-RevId: e69a59f4bf01c17013a64da60b075687aab8323d --- .../com/intellij/ui/ExtendableTextFieldTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/platform-tests/testSrc/com/intellij/ui/ExtendableTextFieldTest.kt b/platform/platform-tests/testSrc/com/intellij/ui/ExtendableTextFieldTest.kt index bb3f912c1501..f16e604cee1c 100644 --- a/platform/platform-tests/testSrc/com/intellij/ui/ExtendableTextFieldTest.kt +++ b/platform/platform-tests/testSrc/com/intellij/ui/ExtendableTextFieldTest.kt @@ -7,6 +7,7 @@ import com.intellij.testFramework.junit5.TestApplication import com.intellij.ui.components.fields.ExtendableTextComponent import com.intellij.ui.components.fields.ExtendableTextField import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertDoesNotThrow import javax.swing.JButton import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -43,4 +44,15 @@ class ExtendableTextFieldTest { val buttons = textField.components.filterIsInstance() assertTrue(buttons.isEmpty()) } +} + +class ExtendableTextFieldTestWithoutApplication { + @Test + fun `adding extension doesn't throw without application`() { + assertDoesNotThrow { + val textField = ExtendableTextField() + val extension = ExtendableTextComponent.Extension.create(AllIcons.General.Add, AllIcons.General.Add, "Add", true) {} + textField.addExtension(extension) + } + } } \ No newline at end of file