Skip to content

Commit

Permalink
Merge pull request #189 from Arquisoft/arregloTestWebDani
Browse files Browse the repository at this point in the history
Arreglados tests webapp
  • Loading branch information
uo276436 authored May 2, 2022
2 parents ee2501c + 456b4e0 commit 2e59b49
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/CartDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function TemporaryDrawer(props: any) {
}),
);
}
}, [addToCart, props]);
}, []);

const [state, setState] = React.useState({
top: false,
Expand Down
7 changes: 2 additions & 5 deletions webapp/src/tests/Historia.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import { render, fireEvent } from "@testing-library/react";
import React from "react";
import Historia from '../pages/Historia';

test('check that the Shop page is rendered correctly', async () => {
test('check that the History page is rendered correctly', async () => {
const {getByText} = render(<Historia/>);
expect(getByText('Sobre nosotros.')).toBeInTheDocument();
expect(getByText("Desarrolladores de la tienda:")).toBeInTheDocument();
expect(getByText("Daniel Ferreira Gómez")).toBeInTheDocument();
expect(getByText("Hugo Gutiérrez Tomás")).toBeInTheDocument();
expect(getByText("Sergio Castillo")).toBeInTheDocument();
expect(getByText("Damir Abdrafikov")).toBeInTheDocument();
expect(getByText("Dede es una tienda de comida desarrollada con REACT y Nodejs que hace uso de SOLID para asegurar al usuario la privacidad y la seguridad de sus datos.")).toBeInTheDocument();
});
2 changes: 1 addition & 1 deletion webapp/src/tests/MiembroAvatar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('check with no member', async () => {
})

test('check with a member', async () => {
const miembros: Miembro[] = [ {nombre:"Maria García Iglesias", imagen: new Object(), uo:"UO854256"}];
const miembros = [ {_name:"Maria García Iglesias", imagen: new Object(), _uo:"UO854256"}];
const { getByText } = render(<MiembroAvatar miembro = {miembros[0]}/>);
expect(getByText('Maria García Iglesias')).toBeInTheDocument();
expect(getByText('UO854256')).toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/tests/ProductoPedido.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ test('check with a product', async () => {
var initialState: Producto = {id:"pollo", nombre:"pollo", precio:1.5, cantidad:2};
const { getByText } = render(<ProductoPedido producto = {initialState}/>);
expect(getByText('pollo(2 uds.)')).toBeInTheDocument();
expect(getByText('Total: 3€')).toBeInTheDocument();
expect(getByText('Total: 3.00€')).toBeInTheDocument();
})

0 comments on commit 2e59b49

Please sign in to comment.