Skip to content

Commit

Permalink
Mock ADD_EXERCISE_SUBMISSION in DOJO exercise page tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjenningz committed Oct 1, 2022
1 parent 41fe5dd commit c86bd58
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __tests__/pages/exercises/[lessonSlug].test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRouter } from 'next/router'
import { MockedProvider } from '@apollo/client/testing'
import getExercisesData from '../../../__dummy__/getExercisesData'
import GET_EXERCISES from '../../../graphql/queries/getExercises'
import ADD_EXERCISE_SUBMISSION from '../../../graphql/queries/addExerciseSubmission'

describe('Exercises page', () => {
const { query } = useRouter()
Expand Down Expand Up @@ -43,6 +44,25 @@ describe('Exercises page', () => {
result: {
data: getExercisesData
}
},
{
request: {
query: ADD_EXERCISE_SUBMISSION,
variables: {
exerciseId: 2,
userAnswer: '3'
}
},
result: {
data: {
addExerciseSubmissions: {
id: 1,
exerciseId: 2,
userId: 3,
userAnswer: '3'
}
}
}
}
]

Expand Down

0 comments on commit c86bd58

Please sign in to comment.