Fix tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-06-03 15:33:50 +02:00
parent 681737bf36
commit 5e6bdb92fb
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
4 changed files with 7 additions and 12 deletions

View File

@ -71,7 +71,7 @@
<![endif]--> <![endif]-->
</td> </td>
</tr> </tr>
<%= render @view_module, @view_template, assigns %> <%= @inner_content %>
<% if Mobilizon.Config.instance_demo_mode?() do %> <% if Mobilizon.Config.instance_demo_mode?() do %>
<!-- BETA WARNING --> <!-- BETA WARNING -->
<tr> <tr>

View File

@ -1,4 +1,4 @@
<%= render @view_module, @view_template, assigns %> <%= @inner_content %>
-- --

View File

@ -508,7 +508,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
actorId: actor.id, actorId: actor.id,
roles: "participant,moderator,administrator,creator", roles: "participant,moderator,administrator,creator",
page: 1, page: 1,
limit: 1 limit: 2
} }
) )
@ -516,11 +516,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
sorted_participants = sorted_participants =
res["data"]["event"]["participants"]["elements"] res["data"]["event"]["participants"]["elements"]
|> Enum.sort_by( |> Enum.filter(&(&1["role"] == "CREATOR"))
&(&1
|> Map.get("actor")
|> Map.get("preferredUsername"))
)
assert sorted_participants == [ assert sorted_participants == [
%{ %{
@ -540,8 +536,8 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
uuid: event.uuid, uuid: event.uuid,
actorId: actor.id, actorId: actor.id,
roles: "participant,moderator,administrator,creator", roles: "participant,moderator,administrator,creator",
page: 2, page: 1,
limit: 1 limit: 2
} }
) )
@ -1321,7 +1317,7 @@ defmodule Mobilizon.GraphQL.Resolvers.ParticipantTest do
|> hd |> hd
update_participation_mutation = """ update_participation_mutation = """
mutation UpdateParticipation($participantId: ID!, $role: String!, $moderatorActorId: ID!) { mutation UpdateParticipation($participantId: ID!, $role: ParticipantRoleEnum!, $moderatorActorId: ID!) {
updateParticipation(id: $participantId, role: $role, moderatorActorId: $moderatorActorId) { updateParticipation(id: $participantId, role: $role, moderatorActorId: $moderatorActorId) {
id, id,
role, role,

View File

@ -3,7 +3,6 @@ defmodule Mobilizon.GraphQL.AbsintheHelpers do
Absinthe helpers for tests Absinthe helpers for tests
""" """
import Plug.Conn
import Phoenix.ConnTest import Phoenix.ConnTest
alias Plug.Conn alias Plug.Conn