Skip to content

Commit

Permalink
Added login and about test
Browse files Browse the repository at this point in the history
  • Loading branch information
UO281801 committed May 1, 2023
1 parent 94b9fce commit 2224b4b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/src/components/mainPage/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect} from "react";
import { TextField, FormGroup } from "@material-ui/core";
import { TextField} from "@material-ui/core";
import { login } from "../../api/api";
import Grid from '@mui/material/Grid';
import Snackbar from '@mui/material/Snackbar';
Expand Down
10 changes: 10 additions & 0 deletions webapp/src/test/mainPage/About.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import About from "../../components/mainPage/About";
import { render, act} from "@testing-library/react";

test('check about is rendered correctly', async () => {
await act(async () => {
const {container, getByText} = render(<About/>)
expect(getByText("Who are we?")).toBeInTheDocument()

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

test('check about is rendered correctly', async () => {
await act(async () => {
const {container, getByText} = render(<LoginForm/>)
expect(getByText("Log in with your POD!")).toBeInTheDocument()
expect(getByText("Solid Community")).toBeInTheDocument()
expect(getByText("Solid Web")).toBeInTheDocument()
expect(getByText("inrupt.net")).toBeInTheDocument()
expect(getByText("pod.inrupt.com")).toBeInTheDocument()

});
})

0 comments on commit 2224b4b

Please sign in to comment.