From 69b10c777615de4e00324d3396c5c107cd939950 Mon Sep 17 00:00:00 2001 From: Lara Date: Tue, 9 Apr 2024 21:35:41 +0200 Subject: [PATCH] Mover tests a carpeta tests --- webapp/src/components/{ => tests}/AddUser.test.js | 2 +- webapp/src/components/{Pages => tests}/Estadisticas.test.js | 2 +- webapp/src/components/{Pages => tests}/Home.test.js | 2 +- webapp/src/components/{Pages => tests}/Juego.test.js | 2 +- webapp/src/components/{Pages => tests}/Layout.test.js | 2 +- webapp/src/components/{ => tests}/Login.test.js | 2 +- webapp/src/components/{Pages => tests}/NotFound.test.js | 2 +- webapp/src/components/{ => tests}/Temporizador.test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename webapp/src/components/{ => tests}/AddUser.test.js (98%) rename webapp/src/components/{Pages => tests}/Estadisticas.test.js (97%) rename webapp/src/components/{Pages => tests}/Home.test.js (98%) rename webapp/src/components/{Pages => tests}/Juego.test.js (99%) rename webapp/src/components/{Pages => tests}/Layout.test.js (96%) rename webapp/src/components/{ => tests}/Login.test.js (98%) rename webapp/src/components/{Pages => tests}/NotFound.test.js (95%) rename webapp/src/components/{ => tests}/Temporizador.test.js (97%) diff --git a/webapp/src/components/AddUser.test.js b/webapp/src/components/tests/AddUser.test.js similarity index 98% rename from webapp/src/components/AddUser.test.js rename to webapp/src/components/tests/AddUser.test.js index 8733488..cbd13e9 100644 --- a/webapp/src/components/AddUser.test.js +++ b/webapp/src/components/tests/AddUser.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { render, fireEvent, screen, waitFor } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; -import AddUser from './AddUser'; +import AddUser from '../AddUser'; const mockAxios = new MockAdapter(axios); diff --git a/webapp/src/components/Pages/Estadisticas.test.js b/webapp/src/components/tests/Estadisticas.test.js similarity index 97% rename from webapp/src/components/Pages/Estadisticas.test.js rename to webapp/src/components/tests/Estadisticas.test.js index 2e7b9d5..bfd3def 100644 --- a/webapp/src/components/Pages/Estadisticas.test.js +++ b/webapp/src/components/tests/Estadisticas.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import axiosMock from 'axios'; -import Estadisticas from './Estadisticas'; +import Estadisticas from '../Pages/Estadisticas'; // Mock de datos para simular la respuesta del servidor const mockUserData = { diff --git a/webapp/src/components/Pages/Home.test.js b/webapp/src/components/tests/Home.test.js similarity index 98% rename from webapp/src/components/Pages/Home.test.js rename to webapp/src/components/tests/Home.test.js index 64d220e..77d5d7d 100644 --- a/webapp/src/components/Pages/Home.test.js +++ b/webapp/src/components/tests/Home.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; -import Home from './Home'; +import Home from '../Pages/Home'; import { BrowserRouter as Router } from "react-router-dom"; const mockNavigate = jest.fn(); diff --git a/webapp/src/components/Pages/Juego.test.js b/webapp/src/components/tests/Juego.test.js similarity index 99% rename from webapp/src/components/Pages/Juego.test.js rename to webapp/src/components/tests/Juego.test.js index 3cbf7cd..2ddf3a2 100644 --- a/webapp/src/components/Pages/Juego.test.js +++ b/webapp/src/components/tests/Juego.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { render, fireEvent, waitFor } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; -import Juego from './Juego'; +import Juego from '../Pages/Juego'; import '@testing-library/jest-dom/extend-expect'; import { act } from 'react-dom/test-utils'; diff --git a/webapp/src/components/Pages/Layout.test.js b/webapp/src/components/tests/Layout.test.js similarity index 96% rename from webapp/src/components/Pages/Layout.test.js rename to webapp/src/components/tests/Layout.test.js index 0c53bf9..c1628ac 100644 --- a/webapp/src/components/Pages/Layout.test.js +++ b/webapp/src/components/tests/Layout.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; // Extiende las expectativas de Jest -import Layout from './Layout'; // Importa el componente a probar +import Layout from '../Pages/Layout'; // Importa el componente a probar import { BrowserRouter as Router } from "react-router-dom"; describe('Layout component', () => { diff --git a/webapp/src/components/Login.test.js b/webapp/src/components/tests/Login.test.js similarity index 98% rename from webapp/src/components/Login.test.js rename to webapp/src/components/tests/Login.test.js index fa6f20d..e8ccbbb 100644 --- a/webapp/src/components/Login.test.js +++ b/webapp/src/components/tests/Login.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { render, fireEvent, screen, waitFor, act } from '@testing-library/react'; import axios from 'axios'; import MockAdapter from 'axios-mock-adapter'; -import Login from './Login'; +import Login from '../Login'; import userEvent from '@testing-library/user-event' const mockAxios = new MockAdapter(axios); diff --git a/webapp/src/components/Pages/NotFound.test.js b/webapp/src/components/tests/NotFound.test.js similarity index 95% rename from webapp/src/components/Pages/NotFound.test.js rename to webapp/src/components/tests/NotFound.test.js index d51f0db..9c40133 100644 --- a/webapp/src/components/Pages/NotFound.test.js +++ b/webapp/src/components/tests/NotFound.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; -import NotFound from './NotFound'; +import NotFound from '../Pages/NotFound'; import { BrowserRouter as Router } from 'react-router-dom'; jest.useFakeTimers(); diff --git a/webapp/src/components/Temporizador.test.js b/webapp/src/components/tests/Temporizador.test.js similarity index 97% rename from webapp/src/components/Temporizador.test.js rename to webapp/src/components/tests/Temporizador.test.js index 3ad7fdd..5f00279 100644 --- a/webapp/src/components/Temporizador.test.js +++ b/webapp/src/components/tests/Temporizador.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { render, screen, fireEvent, act } from '@testing-library/react'; -import Temporizador from './Temporizador'; +import Temporizador from '../Temporizador'; describe('Temporizador', () => { it('renders the initial countdown time', () => {