Skip to content

Commit

Permalink
Fixed footer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
algarfer committed Apr 20, 2024
1 parent 55c8799 commit 5b00213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions webapp/src/__test__/components/Footer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ describe("Footer component", () => {

const currentYear = new Date().getFullYear();
expect(screen.getByText(${currentYear} ASW - WIQ05b`)).toBeInTheDocument();
expect(screen.getByRole("navigation")).toBeInTheDocument();
const appBar = screen.getByRole("navigation");
expect(screen.getByTestId("footer")).toBeInTheDocument();
const appBar = screen.getByTestId("footer");
expect(appBar).toHaveStyle({ backgroundColor: "primary" });
});

test("has fixed position at the bottom of the page", () => {
render(<Footer />);
const appBar = screen.getByRole("navigation");
const appBar = screen.getByTestId("footer");
expect(appBar).toHaveStyle({ top: "auto", bottom: 0, position: "fixed" });
});

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/views/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Container } from "@mui/material";
export default function Footer() {
return (
<Container sx={{height: "7rem"}}>
<AppBar color="primary" sx={{ top: "auto", bottom: 0, position: "fixed" }}>
<AppBar data-testid="footer" color="primary" sx={{ top: "auto", bottom: 0, position: "fixed" }} component="footer">
<Toolbar role="toolbar" sx={{ justifyContent: "center" }}>
<Typography>&copy; {new Date().getFullYear()} ASW - WIQ05b</Typography>
</Toolbar>
Expand Down

0 comments on commit 5b00213

Please sign in to comment.