test: add failing test for remove_form (#39)

This commit is contained in:
kernel-io 2022-05-17 14:37:36 +12:00 committed by GitHub
parent 50f6a108b4
commit b65bf57ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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