mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix cypress tests
This commit is contained in:
parent
b7e36345b9
commit
77fb948c14
@ -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
|
||||
}
|
||||
|
||||
@ -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 })
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user