IJPL-210789 Implement a test that ExtendableTextField extensions can be used without Application

GitOrigin-RevId: e69a59f4bf01c17013a64da60b075687aab8323d
This commit is contained in:
Dmitry Drobotov
2025-10-13 14:03:21 +00:00
committed by intellij-monorepo-bot
parent c9077d9b4c
commit fdec3dbefa
@@ -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<JButton>()
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)
}
}
}