aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-10-05 13:13:51 +0100
committerGravatar GitHub <[email protected]>2020-10-05 13:13:51 +0100
commit91ef1e8d905e1ac68f6a3968f379d0675dfe6dcf (patch)
tree617e685d475acd15a7a6423d3a9b7826ee674f00 /src/tests
parentMerge pull request #14 from python-discord/api/add-dummy-forms (diff)
parentUpdate header test to include custom titles (diff)
Merge pull request #15 from python-discord/forms/add-form-page
Add specific form page
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/components/FormListing.test.tsx8
-rw-r--r--src/tests/components/HeaderBar.test.tsx7
2 files changed, 12 insertions, 3 deletions
diff --git a/src/tests/components/FormListing.test.tsx b/src/tests/components/FormListing.test.tsx
index 4080f4d..82d1380 100644
--- a/src/tests/components/FormListing.test.tsx
+++ b/src/tests/components/FormListing.test.tsx
@@ -3,16 +3,18 @@ import { render } from '@testing-library/react';
import FormListing from "../../components/FormListing";
import { BrowserRouter as Router } from 'react-router-dom';
-import { Form } from '../../api/forms';
+import { AllFormsForm } from '../../api/forms';
-const openFormListing: Form = {
+const openFormListing: AllFormsForm = {
title: "Example form listing",
+ id: "example-form-listing",
description: "My form listing",
open: true
}
-const closedFormListing: Form = {
+const closedFormListing: AllFormsForm = {
title: "Example form listing",
+ id: "example-form-listing",
description: "My form listing",
open: false
}
diff --git a/src/tests/components/HeaderBar.test.tsx b/src/tests/components/HeaderBar.test.tsx
index 3567d7e..2e1f868 100644
--- a/src/tests/components/HeaderBar.test.tsx
+++ b/src/tests/components/HeaderBar.test.tsx
@@ -7,3 +7,10 @@ test('renders header bar with title', () => {
const formListing = getByText(/Python Discord Forms/i);
expect(formListing).toBeInTheDocument();
});
+
+test('renders header bar with custom title', () => {
+ const { getByText } = render(<HeaderBar title="Testing title"/>);
+ const formListing = getByText(/Testing title/i);
+ expect(formListing).toBeInTheDocument();
+});
+