generated from Arquisoft/dede_0
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from Arquisoft/develop
Develop - adding refactoring of tests done by Miguel and removal of code smells
- Loading branch information
Showing
7 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
.../src/components/fragments/NavBar.test.tsx → ...omponents/fragments/tests/NavBar.test.tsx
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
10 changes: 10 additions & 0 deletions
10
webapp/src/components/fragments/tests/PageNotFound.test.tsx
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,10 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import PageNotFound from '../PageNotFound'; | ||
|
||
test("Review view is rendered properly", async () => { | ||
|
||
render(<MemoryRouter><PageNotFound/></MemoryRouter>); | ||
expect(screen.getByText("SORRY")).toBeInTheDocument(); | ||
expect(screen.getByText("We couldn't find the page you're looking for!!")).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
5 changes: 2 additions & 3 deletions
5
.../components/other/DeveloperCards.test.tsx → ...nents/other/tests/DeveloperCards.test.tsx
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
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,21 @@ | ||
import { render } from "@testing-library/react"; | ||
import { BrowserRouter as Router } from "react-router-dom"; | ||
|
||
import AboutUs from "../about_us"; | ||
|
||
/** | ||
* Test that the about us page renders correctly | ||
*/ | ||
test("Cart empty is rendered correctly", async () => { | ||
|
||
const { getByText } = render( | ||
<Router> | ||
<AboutUs/> | ||
</Router> | ||
) | ||
|
||
// The expected content of the page (cards aside) | ||
expect(getByText("Decentralized Delivery")).toBeInTheDocument(); | ||
expect(getByText("DeDe is an online retail system that preserves the privacy of the customers following the SOLID principles. This means that our Decentralized Delivery app will not store user data per se, but will acess, when permission is granted, the information located inside the user's SOLID pod. This information will be used by our app to know the user's address for delivery purposes.")).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
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