Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.vaadin.flow.component.orderedlayout.HorizontalLayout
import com.vaadin.flow.component.orderedlayout.VerticalLayout
import com.github.mvysny.dynatest.DynaNodeGroup
import com.github.mvysny.dynatest.expectList
import com.vaadin.flow.component.Text

fun DynaNodeGroup.depthFirstTreeIteratorTests() {
test("DepthFirstTreeIterator") {
Expand All @@ -28,7 +29,13 @@ fun DynaNodeGroup.depthFirstTreeIteratorTests() {
val expected = mutableListOf<Component>()
val root = VerticalLayout().apply {
expected.add(this)
add(Button("Foo").apply { expected.add(this) })
add(Button("Foo").apply {
expected.add(this)
// In Vaadin 25.1, Button also has a text node
this.children.filter { it is Text }
.findFirst()
.ifPresent { expected.add(it) }
})
add(HorizontalLayout().apply {
expected.add(this)
add(Span().apply { expected.add(this) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ internal fun DynaNodeGroup.locatorTest() {
_get<Button> { caption = "Click Me" }.click()
expectAfterLookupCalled()

expect("Thanks Baron Vladimir Harkonnen, it works!") { _get<Text>().text }
expect("Thanks Baron Vladimir Harkonnen, it works!") { _get<Text>{
// Since Vaadin 25.1, Button contains a Text child
this.predicates.add { textComponent -> textComponent.parent.filter { (it is Button) }.isEmpty }
}.text }
expectAfterLookupCalled()
_get<TextField> { value = "Baron Vladimir Harkonnen" } // test lookup by value
expectAfterLookupCalled()
Expand Down
Loading