Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Nov 15, 2024
1 parent 84f1d7b commit 15474a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ defmodule Orcasite.Notifications.Notification do
|> Ash.load!(:feed)

changeset
|> Ash.Changeset.change_attribute(:meta, %{
|> Ash.Changeset.force_change_attribute(:meta, %{
candidate_id: candidate_id,
node: candidate.feed.slug,
message: Ash.Changeset.get_argument(changeset, :message)
Expand Down
10 changes: 9 additions & 1 deletion server/test/orcasite_web/graphql/moderator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,18 @@ defmodule OrcasiteWeb.ModeratorTest do

assert %{
"data" => %{
"notifyConfirmedCandidate" => %{"result" => %{"id" => _}}
"notifyConfirmedCandidate" => %{"result" => %{"id" => notification_id}}
}
} =
json_response(conn, 200)

candidate_id = candidate.id

notification =
Orcasite.Notifications.Notification |> Ash.get!(notification_id, authorize?: false)

assert %{meta: %{"message" => "Test notification", "candidate_id" => ^candidate_id}} =
notification
end

test "can view notificationsForCandidate", %{conn: conn, candidate: candidate} do
Expand Down

0 comments on commit 15474a3

Please sign in to comment.