Skip to content

Commit

Permalink
Add episode order mutation test
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderVertegaal committed Oct 25, 2024
1 parent 775e201 commit a9f367c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions backend/event/tests/test_event_mutations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from event.models import Episode


def test_episode_order_mutation(graphql_client, episode):
result = graphql_client.execute(
f"""
mutation TestMutation {{
updateEpisodeOrder(
episodeOrderData: [
{{ id: "{episode.id}", rank: 5 }}
]
) {{
ok
errors {{
field
messages
}}
}}
}}
"""
)
assert result["data"]["updateEpisodeOrder"]["ok"] == True
assert result["data"]["updateEpisodeOrder"]["errors"] == []
assert Episode.objects.get(id=episode.id).rank == 5

0 comments on commit a9f367c

Please sign in to comment.