Closed simasch closed 2 years ago
Hi, thanks! While this is fixed, here's a workaround:
testingLifecycleHook = object : TestingLifecycleHook {
private fun getChildrenOf(dialogHeaderFooter: Any): List<Component> {
val rootField =
dialogHeaderFooter.javaClass.superclass.getDeclaredField("root")
rootField.isAccessible = true
val root = rootField.get(dialogHeaderFooter) as Element
return root.children.map { it.component.orElse(null) } .toList().filterNotNull()
}
override fun getAllChildren(component: Component): List<Component> {
var list = super.getAllChildren(component)
if (component is Dialog) {
list = getChildrenOf(component.header) + list + getChildrenOf(component.footer)
}
return list
}
}
Vaadin added Header and Footer to the Dialog.
But neither is visible in Karibu Testing: