mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-210789 Implement a test that ExtendableTextField extensions can be used without Application
GitOrigin-RevId: e69a59f4bf01c17013a64da60b075687aab8323d
This commit is contained in:
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user