Skip to content

Commit

Permalink
Adds a test harness for the CoreComponents generated file
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardarella committed Nov 1, 2024
1 parent d06731b commit a1a02b7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ defmodule LiveViewNative.SwiftUI.MixProject do
{:floki, ">= 0.30.0", only: :test},
{:live_view_native, "~> 0.3.1"},
{:live_view_native_stylesheet, "~> 0.3.1", only: :test},
{:live_view_native_live_form, "~> 0.3.1", only: :test},
{:gettext, "~> 0.20", only: :test},
{:live_view_native_test, github: "liveview-native/live_view_native_test", branch: "main", only: :test},
{:nimble_parsec, "~> 1.3"}
]
Expand Down
3 changes: 3 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
"cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"},
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
"expo": {:hex, :expo, "1.1.0", "f7b9ed7fb5745ebe1eeedf3d6f29226c5dd52897ac67c0f8af62a07e661e5c75", [:mix], [], "hexpm", "fbadf93f4700fb44c331362177bdca9eeb8097e8b0ef525c9cc501cb9917c960"},
"floki": {:hex, :floki, "0.36.2", "a7da0193538c93f937714a6704369711998a51a6164a222d710ebd54020aa7a3", [:mix], [], "hexpm", "a8766c0bc92f074e5cb36c4f9961982eda84c5d2b8e979ca67f5c268ec8ed580"},
"gettext": {:hex, :gettext, "0.26.1", "38e14ea5dcf962d1fc9f361b63ea07c0ce715a8ef1f9e82d3dfb8e67e0416715", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "01ce56f188b9dc28780a52783d6529ad2bc7124f9744e571e1ee4ea88bf08734"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"live_view_native": {:hex, :live_view_native, "0.3.1", "da64f1507e772b6cf8be99c85c6b300a03d64c46ceabc9f00b1f97962cc49e2d", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20.10", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0.4", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.5", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.5", [hex: :sourceror, repo: "hexpm", optional: false]}, {:text_diff, "~> 0.1", [hex: :text_diff, repo: "hexpm", optional: false]}], "hexpm", "fd526dd025f58393a2d648c9ec22383464037f7effe5d62061029743e7572a86"},
"live_view_native_live_form": {:hex, :live_view_native_live_form, "0.3.1", "5cf84867bdc9bfd9341147cfed9355abd1a9bd87ffd10295ba15bc15de7df70e", [:mix], [{:live_view_native, "~> 0.3.1", [hex: :live_view_native, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20.4", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "5a7405463bc12d73dd87a9a9081217cfa4d188545807fcd152c0570f5eb6061a"},
"live_view_native_stylesheet": {:hex, :live_view_native_stylesheet, "0.3.1", "71a1cee29ec3fe0003949250035ec905e6e7c706928e94ff8823be8108267e1b", [:mix], [{:live_view_native, "~> 0.3.1", [hex: :live_view_native, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "ca2a9a47b34be56099d6c1523a2cb69274ba2a5ecff441cacb4b885483fb39b3"},
"live_view_native_test": {:git, "https://github.com/liveview-native/live_view_native_test.git", "539ae931fa3936f3ee2f73ffa11f7100fe6554db", [branch: "main"]},
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
Expand Down
69 changes: 69 additions & 0 deletions test/live_view_native/swiftui/core_components_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
defmodule LiveViewNative.SwiftUI.CoreComponentsTest do
use ExUnit.Case

File.read!("priv/templates/lvn.swiftui.gen/core_components.ex")
|> EEx.eval_string([
context: %{
web_module: LiveViewNativeTest,
module_suffix: SwiftUI
},
assigns: %{
live_form?: true,
gettext: true,
version: Application.spec(:live_view_native_swiftui)[:vsn]
}
])
|> Code.eval_string()

describe "input/1" do

end

describe "error/1" do

end

describe "header/1" do

end

describe "modal/1" do

end

describe "flash/1" do

end

describe "flash_group/1" do

end

describe "simple_form/1" do

end

describe "button/1" do

end

describe "table" do

end

describe "list/1" do

end

describe "image/1" do

end

describe "translate_error/1" do

end

describe "translate_errors/1" do

end
end

0 comments on commit a1a02b7

Please sign in to comment.