Skip to content
Open
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
5 changes: 4 additions & 1 deletion integration_test/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ defmodule Phoenix.Integration.MixProject do
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps()
deps: deps(),
test_ignore_filters: [
&String.starts_with?(&1, "test/fixtures")
]
]
end

Expand Down
17 changes: 17 additions & 0 deletions integration_test/test/code_generation/app_with_defaults_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ defmodule Phoenix.Integration.CodeGeneration.AppWithDefaultsTest do
assert_tests_pass(app_root_path)
end)
end

test "has functioning core_components" do
with_installer_tmp("app_with_defaults", fn tmp_dir ->
{app_root_path, _} = generate_phoenix_app(tmp_dir, "default_app")

dest = Path.join(app_root_path, "test/default_app_web/components")

File.mkdir_p!(dest)
File.cp!(
Path.expand("../fixtures/core_components.exs", __DIR__),
Path.join(dest, "core_components_test.exs")
)

drop_test_database(app_root_path)
assert_tests_pass(app_root_path)
end)
end
end

describe "phx.gen.html" do
Expand Down
19 changes: 19 additions & 0 deletions integration_test/test/fixtures/core_components.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
defmodule DefaultAppWeb.CoreComponentsTest do
import Phoenix.LiveViewTest
import DefaultAppWeb.CoreComponents

use Phoenix.Component
use DefaultAppWeb.ConnCase

describe "label component" do
test "generates a label" do
assigns = %{}

html = rendered_to_string(~H"""
<.input type="checkbox" name="example" label="Click here"/>
""")

assert html =~ "Click here"
end
end
end