Skip to content

Commit 7b0ebf1

Browse files
committed
Test Form and Section nesting
1 parent e9cf4ed commit 7b0ebf1

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

AndroidSwiftUICore/Tests/AndroidSwiftUICoreTests/ControlTests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@ struct ControlTests {
115115
#expect(node.children.count == 2)
116116
}
117117

118+
@Test("Form nests Sections with their header and rows")
119+
func formSection() {
120+
let node = ViewHost(
121+
Form {
122+
Section("General") {
123+
Text("Wi-Fi")
124+
Text("Bluetooth")
125+
}
126+
}
127+
).evaluate()
128+
#expect(node.type == "Form")
129+
let section = node.children.first
130+
#expect(section?.type == "Section")
131+
#expect(section?.props["header"] == .string("General"))
132+
#expect(section?.children.count == 2)
133+
}
134+
118135
@Test("Environment objects reach @Environment properties in the subtree")
119136
func environmentInjection() {
120137
final class Model { var value = 42 }

0 commit comments

Comments
 (0)