-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure components file recompiles when changed
- Loading branch information
1 parent
07605ff
commit a39d0f8
Showing
5 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ defmodule LiveViewNative.SwiftUI.CoreComponentsTest do | |
|
||
import LiveViewNativeTest.CoreComponents.SwiftUI | ||
|
||
import LiveViewNative.LiveForm.Component | ||
import LiveViewNative.Component, only: [sigil_LVN: 2] | ||
import LiveViewNative.Template.Parser, only: [parse_document!: 1] | ||
|
||
|
@@ -64,7 +65,30 @@ defmodule LiveViewNative.SwiftUI.CoreComponentsTest do | |
end | ||
|
||
describe "simple_form/1" do | ||
|
||
test "can render form with an input" do | ||
params = %{"email" => "[email protected]"} | ||
form = to_form(params, as: "user") | ||
|
||
assigns = %{form: form} | ||
|
||
template = ~LVN""" | ||
<.simple_form for={@form}> | ||
<.input field={@form[:email]} label="Email"/> | ||
</.simple_form> | ||
""" | ||
|
||
assert t2h(template) == | ||
~X""" | ||
<LiveForm> | ||
<Form> | ||
<VStack alignment="leading"> | ||
<TextField id="user_email" name="user[email]" style="" text="[email protected]">Email</TextField> | ||
</VStack> | ||
<Section/> | ||
</Form> | ||
</LiveForm> | ||
""" | ||
end | ||
end | ||
|
||
describe "button/1" do | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters