generated from Arquisoft/dede_0
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #162 from Arquisoft/enol_tests
Merge con nuevos test y validacion a la hora de pagar
- Loading branch information
Showing
4 changed files
with
117 additions
and
42 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
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 React from 'react' | ||
import { getByDisplayValue, render } from "@testing-library/react"; | ||
import Login from "./Login"; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
|
||
test('check that everything is rendering propertly', async () => { | ||
|
||
const { getByText } = render(<BrowserRouter><Login/></BrowserRouter>); | ||
expect(getByText('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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react' | ||
import { render, screen } from "@testing-library/react"; | ||
import PedidosList from "./PedidosList"; | ||
import * as api from '../../api/api'; | ||
import { Pedido, Product } from "../../shared/shareddtypes"; | ||
import { act } from 'react-dom/test-utils'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import * as solid from "@inrupt/solid-ui-react"; | ||
|
||
test('check that everything is rendering propertly', async () => { | ||
|
||
function miGetPedidos() { | ||
return Promise.resolve([{ | ||
id: "1", | ||
estado: "En camino", | ||
nombre_dest: "Enol", | ||
email: "Email", | ||
precio_final: 20 | ||
} as Pedido | ||
|
||
]); | ||
} | ||
|
||
jest.spyOn(api, 'getPedidosByEmail').mockImplementation(miGetPedidos); | ||
//jest.spyOn(solid, 'useSession').mockImplementation(()=> ({session:{info:{webId:"abc#abc"}}} as any)); | ||
jest.mock("@inrupt/solid-client"); | ||
await act(async () => { | ||
render(<BrowserRouter><PedidosList/></BrowserRouter>)}); | ||
expect(screen.getByText('En camino')).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