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