kandimat/redaktions-app/src/backend/queries/question.mock.ts
Christoph Lienhard 587c0cdeba
#11 Add integration test for editing a question
Also:
* introduce __typename to all response types
2020-12-30 01:10:30 +01:00

49 lines
1 KiB
TypeScript

import {MockedResponse} from "@apollo/client/testing";
import {BasicQuestionResponse, GET_ALL_QUESTIONS, GetAllQuestionsResponse} from "./question";
export const questionNodesMock: Array<BasicQuestionResponse> = [{
id: "q1",
title: "Question 1?",
description: "Further information for Q1",
categoryByCategoryRowId: {
id: "c1",
rowId: 1,
title: "Category 1",
__typename: "Category"
},
__typename: "Question",
},
{
id: "q2",
title: "Question 2?",
description: "Further information for Q2",
categoryByCategoryRowId: null,
__typename: "Question",
},
{
id: "q3",
title: "Question 3?",
description: null,
categoryByCategoryRowId: null,
__typename: "Question",
}
];
export const getAllQuestionsMock: Array<MockedResponse<GetAllQuestionsResponse>> = [
{
request: {
query: GET_ALL_QUESTIONS,
},
result: {
data: {
allQuestions: {
nodes: questionNodesMock,
__typename: "QuestionsConnection",
}
}
},
},
]