@@ -393,6 +393,45 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
393393 end
394394 end
395395
396+ describe "debug_attributes" do
397+ test "adds debug_attributes when debug_heex_annotations is already set" do
398+ test_project (
399+ app_name: :my_app ,
400+ files: % {
401+ "config/dev.exs" => """
402+ import Config
403+
404+ config :phoenix_live_view,
405+ enable_expensive_runtime_checks: true,
406+ debug_heex_annotations: true
407+ """
408+ }
409+ )
410+ |> run_upgrade ( )
411+ |> assert_has_patch ( "config/dev.exs" , """
412+ - | debug_heex_annotations: true
413+ + | debug_heex_annotations: true,
414+ + | debug_attributes: true
415+ """ )
416+ end
417+
418+ test "does not add debug_attributes when debug_heex_annotations is not set" do
419+ test_project (
420+ app_name: :my_app ,
421+ files: % {
422+ "config/dev.exs" => """
423+ import Config
424+
425+ config :phoenix_live_view,
426+ enable_expensive_runtime_checks: true
427+ """
428+ }
429+ )
430+ |> run_upgrade ( )
431+ |> assert_unchanged ( "config/dev.exs" )
432+ end
433+ end
434+
396435 describe "full upgrade scenario" do
397436 test "performs complete upgrade for a Phoenix project" do
398437 full_project ( )
@@ -409,6 +448,11 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
409448 - | reloadable_compilers: [:elixir, :app]
410449 + | reloadable_compilers: [:phoenix_live_view, :elixir, :app]
411450 """ )
451+ |> assert_has_patch ( "config/dev.exs" , """
452+ - | debug_heex_annotations: true
453+ + | debug_heex_annotations: true,
454+ + | debug_attributes: true
455+ """ )
412456 |> assert_has_patch ( "config/config.exs" , """
413457 - | args: ~w(js/app.js --bundle --outdir=../priv/static/assets),
414458 + | args: ~w(js/app.js --bundle --outdir=../priv/static/assets --alias:@=.),
@@ -464,6 +508,10 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
464508 config :my_app, MyAppWeb.Endpoint,
465509 http: [port: 4000],
466510 reloadable_compilers: [:elixir, :app]
511+
512+ config :phoenix_live_view,
513+ enable_expensive_runtime_checks: true,
514+ debug_heex_annotations: true
467515 """
468516 }
469517 )
0 commit comments