-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
573 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Created on Mon Oct 30 2023 | ||
* Author: Connor Doman | ||
*/ | ||
|
||
import "@testing-library/jest-dom"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { Footer } from "@components/Footer"; | ||
|
||
describe("Footer", () => { | ||
it("matches snapshot", () => { | ||
const wrapper = render(<Footer />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it("contains an HTML footer element", () => { | ||
render(<Footer />); | ||
expect(screen.getByRole("contentinfo")).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders the site logo", () => { | ||
render(<Footer />); | ||
const logo = screen.getByRole("link", { name: "PrivacyPal logo" }); | ||
expect(logo).toBeInTheDocument(); | ||
expect(logo).toHaveAttribute("href", "/"); | ||
}); | ||
|
||
it("renders the site links", () => { | ||
render(<Footer />); | ||
expect(screen.getByRole("link", { name: "Welcome" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "About Us" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "Sign Up" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "Log in" })).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders social media links", () => { | ||
render(<Footer />); | ||
expect(screen.getByRole("link", { name: "GitHub logo" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "YouTube logo" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "mail icon" })).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Created on Mon Oct 30 2023 | ||
* Author: Connor Doman | ||
*/ | ||
|
||
import "@testing-library/jest-dom"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { Header } from "@components/Header"; | ||
|
||
describe("Header", () => { | ||
it("matches snapshot", () => { | ||
const wrapper = render(<Header />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it("contains an HTML header element", () => { | ||
render(<Header />); | ||
expect(screen.getByRole("banner")).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders the header", () => { | ||
render(<Header />); | ||
expect(screen.getByRole("heading", { name: "A SOLUTION TO ABSOLUTE PRIVACY." })).toBeInTheDocument(); | ||
}); | ||
|
||
it("renders the header image", () => { | ||
render(<Header />); | ||
expect(screen.getByRole("img", { name: "logo" })).toBeInTheDocument(); | ||
}); | ||
}); |
284 changes: 284 additions & 0 deletions
284
app/front-end/__tests__/__snapshots__/Footer.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Footer matches snapshot 1`] = ` | ||
{ | ||
"asFragment": [Function], | ||
"baseElement": <body> | ||
<div> | ||
<footer | ||
class="site-footer" | ||
> | ||
<div | ||
class="footer-item" | ||
> | ||
<a | ||
href="/" | ||
> | ||
<img | ||
alt="PrivacyPal logo" | ||
class="footer-logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
</div> | ||
<div | ||
class="footer-item" | ||
> | ||
Other Sites: | ||
<div | ||
class="footer-links" | ||
> | ||
<a | ||
href="#welcomepage" | ||
> | ||
Welcome | ||
</a> | ||
<a | ||
href="#aboutus" | ||
> | ||
About Us | ||
</a> | ||
<a | ||
href="#signup" | ||
> | ||
Sign Up | ||
</a> | ||
<span> | ||
| | ||
</span> | ||
<a | ||
href="/login" | ||
> | ||
Log in | ||
</a> | ||
</div> | ||
</div> | ||
<div | ||
class="footer-item" | ||
> | ||
<div | ||
class="contact" | ||
> | ||
Follow Us | ||
<a | ||
href="https://github.com/COSC-499-W2023/year-long-project-team-1" | ||
> | ||
<img | ||
alt="GitHub logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
<a | ||
href="#youtube" | ||
> | ||
<img | ||
alt="YouTube logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
<a | ||
href="#Email" | ||
> | ||
<img | ||
alt="mail icon" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
</footer> | ||
</div> | ||
</body>, | ||
"container": <div> | ||
<footer | ||
class="site-footer" | ||
> | ||
<div | ||
class="footer-item" | ||
> | ||
<a | ||
href="/" | ||
> | ||
<img | ||
alt="PrivacyPal logo" | ||
class="footer-logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
</div> | ||
<div | ||
class="footer-item" | ||
> | ||
Other Sites: | ||
<div | ||
class="footer-links" | ||
> | ||
<a | ||
href="#welcomepage" | ||
> | ||
Welcome | ||
</a> | ||
<a | ||
href="#aboutus" | ||
> | ||
About Us | ||
</a> | ||
<a | ||
href="#signup" | ||
> | ||
Sign Up | ||
</a> | ||
<span> | ||
| | ||
</span> | ||
<a | ||
href="/login" | ||
> | ||
Log in | ||
</a> | ||
</div> | ||
</div> | ||
<div | ||
class="footer-item" | ||
> | ||
<div | ||
class="contact" | ||
> | ||
Follow Us | ||
<a | ||
href="https://github.com/COSC-499-W2023/year-long-project-team-1" | ||
> | ||
<img | ||
alt="GitHub logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
<a | ||
href="#youtube" | ||
> | ||
<img | ||
alt="YouTube logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
<a | ||
href="#Email" | ||
> | ||
<img | ||
alt="mail icon" | ||
data-nimg="1" | ||
decoding="async" | ||
height="40" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fimg.jpg&w=96&q=75" | ||
srcset="/_next/image?url=%2Fimg.jpg&w=48&q=75 1x, /_next/image?url=%2Fimg.jpg&w=96&q=75 2x" | ||
style="color: transparent;" | ||
width="40" | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
</footer> | ||
</div>, | ||
"debug": [Function], | ||
"findAllByAltText": [Function], | ||
"findAllByDisplayValue": [Function], | ||
"findAllByLabelText": [Function], | ||
"findAllByPlaceholderText": [Function], | ||
"findAllByRole": [Function], | ||
"findAllByTestId": [Function], | ||
"findAllByText": [Function], | ||
"findAllByTitle": [Function], | ||
"findByAltText": [Function], | ||
"findByDisplayValue": [Function], | ||
"findByLabelText": [Function], | ||
"findByPlaceholderText": [Function], | ||
"findByRole": [Function], | ||
"findByTestId": [Function], | ||
"findByText": [Function], | ||
"findByTitle": [Function], | ||
"getAllByAltText": [Function], | ||
"getAllByDisplayValue": [Function], | ||
"getAllByLabelText": [Function], | ||
"getAllByPlaceholderText": [Function], | ||
"getAllByRole": [Function], | ||
"getAllByTestId": [Function], | ||
"getAllByText": [Function], | ||
"getAllByTitle": [Function], | ||
"getByAltText": [Function], | ||
"getByDisplayValue": [Function], | ||
"getByLabelText": [Function], | ||
"getByPlaceholderText": [Function], | ||
"getByRole": [Function], | ||
"getByTestId": [Function], | ||
"getByText": [Function], | ||
"getByTitle": [Function], | ||
"queryAllByAltText": [Function], | ||
"queryAllByDisplayValue": [Function], | ||
"queryAllByLabelText": [Function], | ||
"queryAllByPlaceholderText": [Function], | ||
"queryAllByRole": [Function], | ||
"queryAllByTestId": [Function], | ||
"queryAllByText": [Function], | ||
"queryAllByTitle": [Function], | ||
"queryByAltText": [Function], | ||
"queryByDisplayValue": [Function], | ||
"queryByLabelText": [Function], | ||
"queryByPlaceholderText": [Function], | ||
"queryByRole": [Function], | ||
"queryByTestId": [Function], | ||
"queryByText": [Function], | ||
"queryByTitle": [Function], | ||
"rerender": [Function], | ||
"unmount": [Function], | ||
} | ||
`; |
Oops, something went wrong.