From c86bd581ab449496690ba78934b8979b83b53cec Mon Sep 17 00:00:00 2001 From: Bryan Jennings Date: Sat, 1 Oct 2022 01:49:56 -0700 Subject: [PATCH] Mock ADD_EXERCISE_SUBMISSION in DOJO exercise page tests --- .../pages/exercises/[lessonSlug].test.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/__tests__/pages/exercises/[lessonSlug].test.js b/__tests__/pages/exercises/[lessonSlug].test.js index 3c25466ec..738271e14 100644 --- a/__tests__/pages/exercises/[lessonSlug].test.js +++ b/__tests__/pages/exercises/[lessonSlug].test.js @@ -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() @@ -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' + } + } + } } ]