Skip to content

Commit

Permalink
Update tests with username
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Jan 22, 2024
1 parent 276fcb4 commit 1db5fdc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/test/orcasite_web/graphql/accounts_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defmodule OrcasiteWeb.GraphqlTest.AccountsTest do

@user_params %{
email: "nonadmin@example.com",
username: "nonadmin",
password: "password",
password_confirmation: "password",
first_name: "Non",
Expand Down
2 changes: 2 additions & 0 deletions server/test/orcasite_web/graphql/moderator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ defmodule OrcasiteWeb.ModeratorTest do

@moderator_params %{
email: "moderator@example.com",
username: "moderator",
password: "password",
password_confirmation: "password"
}

@user_params %{
email: "user@example.com",
username: "user",
password: "password",
password_confirmation: "password"
}
Expand Down
2 changes: 2 additions & 0 deletions server/test/support/authentication_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ defmodule OrcasiteWeb.TestSupport.AuthenticationHelper do
end

def register_user(conn, %{
username: username,
email: email,
password: password,
first_name: first_name,
Expand All @@ -42,6 +43,7 @@ defmodule OrcasiteWeb.TestSupport.AuthenticationHelper do
"query" => register_mutation(),
"variables" => %{
"email" => email,
"username" => username,
"password" => password,
"passwordConfirmation" => password,
"firstName" => first_name,
Expand Down
2 changes: 2 additions & 0 deletions server/test/support/graphql_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ defmodule OrcasiteWeb.TestSupport.GraphqlHelper do
"""
mutation registerWithPassword(
$email: String!,
$username: String!,
$firstName: String,
$lastName: String,
$password: String!,
$passwordConfirmation: String!
) {
registerWithPassword(input: {
email: $email,
username: $username,
firstName: $firstName,
lastName: $lastName,
password: $password,
Expand Down

0 comments on commit 1db5fdc

Please sign in to comment.