From a43fa25ffb3c32a58f6619423bb33eb64c7d2d45 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Mon, 14 Dec 2020 13:49:14 +0200 Subject: Update tests to match with changes in discovery --- src/tests/components/FormListing.test.tsx | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'src/tests/components') diff --git a/src/tests/components/FormListing.test.tsx b/src/tests/components/FormListing.test.tsx index 5062a95..0afe10c 100644 --- a/src/tests/components/FormListing.test.tsx +++ b/src/tests/components/FormListing.test.tsx @@ -4,20 +4,37 @@ import '@testing-library/jest-dom/extend-expect'; import FormListing from "../../components/FormListing"; import { BrowserRouter as Router } from 'react-router-dom'; -import { AllFormsForm } from '../../api/forms'; +import { Form, FormFeatures } from '../../api/forms'; +import { QuestionType } from '../../api/question'; -const openFormListing: AllFormsForm = { - title: "Example form listing", +const openFormListing: Form = { + name: "Example form listing", id: "example-form-listing", description: "My form listing", - open: true + features: [FormFeatures.Discoverable, FormFeatures.Open], + questions: [ + { + "id": "my-question", + "name": "My question", + "type": QuestionType.ShortText, + "data": {} + } + ] } -const closedFormListing: AllFormsForm = { - title: "Example form listing", +const closedFormListing: Form = { + name: "Example form listing", id: "example-form-listing", description: "My form listing", - open: false + features: [FormFeatures.Discoverable], + questions: [ + { + "id": "what-should-i-ask", + "name": "What should I ask?", + "type": QuestionType.ShortText, + "data": {} + } + ] } test('renders form listing with specified title', () => { -- cgit v1.2.3