From 1246afa7254e1314dd645daf85f15adb9c8b50de Mon Sep 17 00:00:00 2001 From: Santiago21112001 Date: Wed, 6 Mar 2024 07:21:50 +0100 Subject: [PATCH] Tests React salvo Game.js y organizado el directorio components --- webapp/src/App.js | 4 +-- webapp/src/App.test.js | 12 ++++--- .../src/components/{ => adduser}/AddUser.js | 0 .../components/{ => adduser}/AddUser.test.js | 0 .../{styles => components/footer}/Footer.css | 0 webapp/src/components/{ => footer}/Footer.js | 2 +- webapp/src/components/footer/Footer.test.js | 27 +++++++++++++++ webapp/src/components/{ => login}/Login.js | 2 +- .../src/components/{ => login}/Login.test.js | 0 webapp/src/components/{ => navbar}/NavBar.js | 2 +- webapp/src/components/navbar/NavBar.test.js | 33 +++++++++++++++++++ .../{styles => components/navbar}/Navbar.css | 0 12 files changed, 72 insertions(+), 10 deletions(-) rename webapp/src/components/{ => adduser}/AddUser.js (100%) rename webapp/src/components/{ => adduser}/AddUser.test.js (100%) rename webapp/src/{styles => components/footer}/Footer.css (100%) rename webapp/src/components/{ => footer}/Footer.js (83%) create mode 100644 webapp/src/components/footer/Footer.test.js rename webapp/src/components/{ => login}/Login.js (98%) rename webapp/src/components/{ => login}/Login.test.js (100%) rename webapp/src/components/{ => navbar}/NavBar.js (93%) create mode 100644 webapp/src/components/navbar/NavBar.test.js rename webapp/src/{styles => components/navbar}/Navbar.css (100%) diff --git a/webapp/src/App.js b/webapp/src/App.js index 2432b7e..76c708e 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import AddUser from './components/AddUser'; -import Login from './components/Login'; +import AddUser from './components/adduser/AddUser'; +import Login from './components/login/Login'; import CssBaseline from '@mui/material/CssBaseline'; import Container from '@mui/material/Container'; import Typography from '@mui/material/Typography'; diff --git a/webapp/src/App.test.js b/webapp/src/App.test.js index 2a50f56..9193c9a 100644 --- a/webapp/src/App.test.js +++ b/webapp/src/App.test.js @@ -1,8 +1,10 @@ -import { render, screen } from '@testing-library/react'; +import React from 'react'; +import { render, screen, fireEvent } from '@testing-library/react'; import App from './App'; -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/WIQ_ES04C/i); - expect(linkElement).toBeInTheDocument(); +describe('App Component', () => { + test('renders App component', () => { + render(); + expect(screen.getByText(/Welcome to the 2024 edition of the Software Architecture course/i)).toBeInTheDocument(); + }); }); diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/adduser/AddUser.js similarity index 100% rename from webapp/src/components/AddUser.js rename to webapp/src/components/adduser/AddUser.js diff --git a/webapp/src/components/AddUser.test.js b/webapp/src/components/adduser/AddUser.test.js similarity index 100% rename from webapp/src/components/AddUser.test.js rename to webapp/src/components/adduser/AddUser.test.js diff --git a/webapp/src/styles/Footer.css b/webapp/src/components/footer/Footer.css similarity index 100% rename from webapp/src/styles/Footer.css rename to webapp/src/components/footer/Footer.css diff --git a/webapp/src/components/Footer.js b/webapp/src/components/footer/Footer.js similarity index 83% rename from webapp/src/components/Footer.js rename to webapp/src/components/footer/Footer.js index 7143c16..0772600 100644 --- a/webapp/src/components/Footer.js +++ b/webapp/src/components/footer/Footer.js @@ -1,5 +1,5 @@ import React from 'react'; -import '../styles/Footer.css'; // Asegúrate de importar tu archivo de estilos si es necesario +import './Footer.css'; // Asegúrate de importar tu archivo de estilos si es necesario const Footer = () => (