Skip to content

Commit 17d9ef1

Browse files
committed
Allow stacks without dash, fix tests
1 parent 556f9e9 commit 17d9ef1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/LiveViewNative/BuiltinRegistry.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ struct BuiltinRegistry {
2020
SecureField<R>(element: element, context: context)
2121
case "text":
2222
Text(context: context)
23-
case "h-stack":
23+
case "h-stack", "hstack":
2424
HStack<R>(element: element, context: context)
25-
case "v-stack":
25+
case "v-stack", "vstack":
2626
VStack<R>(element: element, context: context)
27-
case "z-stack":
27+
case "z-stack", "zstack":
2828
ZStack<R>(element: element, context: context)
2929
case "button":
3030
Button<R>(element: element, context: context, action: nil)

Tests/RenderingTests/TextFieldTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import SwiftUI
1212
@MainActor
1313
final class TextFieldTests: XCTestCase {
1414
func testSimple() throws {
15-
try assertMatch(#"<textfield placeholder="Type here" />"#) {
15+
try assertMatch(#"<text-field placeholder="Type here" />"#) {
1616
TextField("Type here", text: .constant(""))
1717
}
18-
try assertMatch(#"<securefield placeholder="Password" />"#) {
18+
try assertMatch(#"<secure-field placeholder="Password" />"#) {
1919
SecureField("Password", text: .constant(""))
2020
}
2121
}
2222
func testPrompt() throws {
23-
try assertMatch(#"<textfield placeholder="Placeholder" prompt="Prompt" />"#) {
23+
try assertMatch(#"<text-field placeholder="Placeholder" prompt="Prompt" />"#) {
2424
TextField("Placeholder", text: .constant(""), prompt: Text("Prompt"))
2525
}
26-
try assertMatch(#"<securefield placeholder="Placeholder" prompt="Prompt" />"#) {
26+
try assertMatch(#"<secure-field placeholder="Placeholder" prompt="Prompt" />"#) {
2727
SecureField("Placeholder", text: .constant(""), prompt: Text("Prompt"))
2828
}
2929
}

0 commit comments

Comments
 (0)