From b65bf57ebf96526f6c5ab1a243a8fdadf5262f96 Mon Sep 17 00:00:00 2001 From: kernel-io Date: Tue, 17 May 2022 14:37:36 +1200 Subject: [PATCH] test: add failing test for remove_form (#39) --- test/form_test.exs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/form_test.exs b/test/form_test.exs index 2fdb621..8891043 100644 --- a/test/form_test.exs +++ b/test/form_test.exs @@ -190,6 +190,15 @@ defmodule AshPhoenix.FormTest do assert form.changed? end + test "removing a non-existant form should not change touched_forms" do + form = + Post + |> Form.for_create(:create, api: Api, forms: [auto?: true]) + |> AshPhoenix.Form.remove_form([:author]) + + assert MapSet.member?(form.touched_forms, "author") == false + end + test "removing a form that was added does not mark the form as changed" do post = Post