diff options
author | 2020-12-14 13:49:14 +0200 | |
---|---|---|
committer | 2020-12-14 13:49:14 +0200 | |
commit | a43fa25ffb3c32a58f6619423bb33eb64c7d2d45 (patch) | |
tree | a8a85715f0008f1b1ce300363148f94ce62bbebd /src/tests/components | |
parent | Update LandingPage to use forms from API (diff) |
Update tests to match with changes in discovery
Diffstat (limited to 'src/tests/components')
-rw-r--r-- | src/tests/components/FormListing.test.tsx | 31 |
1 files changed, 24 insertions, 7 deletions
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', () => { |