587c0cdeba
Also: * introduce __typename to all response types
49 lines
1 KiB
TypeScript
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",
|
|
}
|
|
}
|
|
},
|
|
},
|
|
]
|
|
|