generated from Arquisoft/lomap_0
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #190 from Arquisoft/finalTests
Final tests -> master
- Loading branch information
Showing
11 changed files
with
111 additions
and
24 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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
# LoMap: ES1a | ||
|
||
[![Actions Status](https://github.com/arquisoft/lomap_es1a/workflows/CI%20for%20LOMAP_0/badge.svg)](https://github.com/arquisoft/lomap_es1a/actions) | ||
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_es1a&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_es1a) | ||
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_es1a&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_es1a) | ||
|
||
![alt text](lomap_logo.png "Title") | ||
<h1 align="center"> LoMap: ES1A </h1> | ||
|
||
<p align="center" margin-top="2em"> | ||
<img src="lomap_logo.png" alt="LoMap logo"> | ||
</p> | ||
|
||
<p align="center" margin-top="2em"> | ||
<a href="https://youtu.be/8jDXuokrXMs"> <b>Demonstration video</b> </a> - <a href="https://20.108.13.14"> <b>Deployed website</b> </a> | ||
</p> | ||
|
||
## Team members | ||
- Andrés Ángel González Granda - [email protected] | ||
|
@@ -34,12 +40,12 @@ npm install | |
npm start | ||
``` | ||
|
||
Now the webapp: | ||
Tu run the webapp you need to create a production build in order for the restapi to work properly: | ||
|
||
```shell | ||
cd webapp | ||
npm install | ||
npm start | ||
npm run build | ||
npm run prod | ||
``` | ||
|
||
You should be able to access the application in [http://localhost:3000](http://localhost:3000). | ||
|
@@ -50,4 +56,4 @@ You should be able to access the application in [http://localhost:3000](http://l | |
|
||
## Deployment | ||
|
||
<a href="http://20.108.13.14"> Deployed on Azure </a> | ||
<a href="https://20.108.13.14"> Deployed on Azure </a> |
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
/// <reference types="react-scripts" /> | ||
/// <reference types="react-scripts" /> |
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,32 @@ | ||
import React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
import Home from "../pages/Home"; | ||
import Map from "../components/home/SideForm"; | ||
import App from "../App"; | ||
import SideForm from "../components/home/SideForm"; | ||
import MarkerInfo from "../components/home/MarkerInfo"; | ||
import Filter from "../components/home/Filter"; | ||
import AddLocationModal from "../components/home/AddLocationModal"; | ||
|
||
describe("Home component", () => { | ||
test("renders sideform", () => { | ||
render(<SideForm show={true} setOpen={() => {}} showNotification={() => {}} reloadMap={() => {}}/>); | ||
const title = screen.getByText("Add a location"); | ||
expect(title).toBeInTheDocument(); | ||
}); | ||
|
||
test("renders markerinfo", () => { | ||
render(<MarkerInfo show={true} location={undefined} setOpen={(state:boolean) => {}} openModal={() => {}} cardList={undefined}/>) | ||
const button = screen.getByText("Add info"); | ||
expect(button).toBeInTheDocument(); | ||
}) | ||
|
||
test("renders filter", () => { | ||
render(<Filter toggleFriends={true} reloadMap={(category:string) => {}} toggleFilter={() => {}}/>) | ||
}) | ||
|
||
test("renders addLocationModal", () => { | ||
render(<AddLocationModal modalIsOpen={true} redirectToLogin={false} closeModal={() =>{}} showNotification={() => {}} selectedLocation={undefined} />) | ||
}) | ||
|
||
}); |
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,15 @@ | ||
import { render, fireEvent, screen, RenderResult} from '@testing-library/react'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import NavBar from '../components/NavBar'; | ||
|
||
describe('NavBar', () => { | ||
it('should go to the login page when clicked', () => { | ||
const { getByRole } = render( | ||
<BrowserRouter> | ||
<NavBar /> | ||
</BrowserRouter> | ||
); | ||
const login = screen.getByRole('button', {name: 'Log in'}); | ||
expect(login).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