From 74c3ed23904a2ed672019275ccefb6c87d9bd7d1 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 29 Sep 2020 01:14:12 +0100 Subject: Update tests to match new form listing component --- src/tests/components/FormListing.test.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/tests') diff --git a/src/tests/components/FormListing.test.tsx b/src/tests/components/FormListing.test.tsx index 26c7c93..cb06201 100644 --- a/src/tests/components/FormListing.test.tsx +++ b/src/tests/components/FormListing.test.tsx @@ -2,28 +2,30 @@ import React from 'react'; import { render } from '@testing-library/react'; import FormListing from "../../components/FormListing"; +import { BrowserRouter as Router } from 'react-router-dom'; + test('renders form listing with specified title', () => { - const { getByText } = render(); + const { getByText } = render(); const formListing = getByText(/Example form listing/i); expect(formListing).toBeInTheDocument(); }); test('renders form listing with specified description', () => { - const { getByText } = render(); + const { getByText } = render(); const formListing = getByText(/My form listing/i); expect(formListing).toBeInTheDocument(); }); test('renders form listing with background green colour for open', () => { - const { container } = render(); - const elem = container.querySelector("div"); + const { container } = render(); + const elem = container.querySelector("a"); const style = window.getComputedStyle(elem); expect(style.backgroundColor).toBe("rgb(67, 181, 129)"); }); test('renders form listing with background dark colour for closed', () => { - const { container } = render(); - const elem = container.querySelector("div"); + const { container } = render(); + const elem = container.querySelector("a"); const style = window.getComputedStyle(elem); expect(style.backgroundColor).toBe("rgb(44, 47, 51)"); }); -- cgit v1.2.3