diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 9f62a2818..25f4c6e35 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -1,5 +1,6 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps' import { VERSION } from '../../constants/terms-and-conditions-version.js' +import { gql } from '../../../backend/src/helpers/jest' /* global cy */ @@ -128,7 +129,7 @@ Given('somebody reported the following posts:', table => { cy.factory() .create('User', submitter) .authenticateAs(submitter) - .mutate(`mutation($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) { + .mutate(gql`mutation($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) { fileReport(resourceId: $resourceId, reasonCategory: $reasonCategory, reasonDescription: $reasonDescription) { id } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index ec4794235..f52b38faf 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -18,7 +18,7 @@ import helpers from "./helpers"; import users from "../fixtures/users.json"; import { GraphQLClient, request } from 'graphql-request' import { gql } from '../../backend/src/helpers/jest' -import { GRAPHQL_URI } from '../../backend/src/config' +import config from '../../backend/src/config' const switchLang = name => { cy.get(".locale-menu").click(); @@ -31,7 +31,7 @@ const authenticatedHeaders = async (variables) => { login(email: $email, password: $password) } ` - const response = await request(GRAPHQL_URI, mutation, variables) + const response = await request(config.GRAPHQL_URI, mutation, variables) return { authorization: `Bearer ${response.login}` } } @@ -100,8 +100,7 @@ Cypress.Commands.add( 'authenticateAs', async ({email, password}) => { const headers = await authenticatedHeaders({ email, password }) - console.log(headers) - return new GraphQLClient(GRAPHQL_URI, { headers }) + return new GraphQLClient(config.GRAPHQL_URI, { headers }) } )