Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UO281801 committed May 1, 2023
1 parent f91e6a4 commit dee6991
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions webapp/src/test/mainPage/Contact.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Contact from "../../components/mainPage/Contact";
import { render, act} from "@testing-library/react";

test('check contact is rendered correctly', async () => {

await act(async () => {
const {container, getByText} = render(<Contact/>)
expect(getByText("Contact us!")).toBeInTheDocument()

});
})
17 changes: 17 additions & 0 deletions webapp/src/test/mainPage/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { render, act} from "@testing-library/react";
import Footer from "../../components/mainPage/Footer";
import { BrowserRouter } from "react-router-dom";

test('check footer is rendered correctly', async () => {

await act(async () => {
const {container, getByText} = render(
<BrowserRouter>
<Footer/>
</BrowserRouter>
)
expect(getByText("Contact")).toBeInTheDocument()
expect(getByText("About us")).toBeInTheDocument()

});
})
11 changes: 11 additions & 0 deletions webapp/src/test/mainPage/Home.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Contact from "../../components/mainPage/Contact";
import { render, act} from "@testing-library/react";

test('check home is rendered correctly', async () => {

await act(async () => {
const {container, getByText} = render(<Contact/>)
expect(getByText("Contact us!")).toBeInTheDocument()

});
})

0 comments on commit dee6991

Please sign in to comment.