From b74769a83721fc346e30dbdc9601a32da5cc1132 Mon Sep 17 00:00:00 2001 From: Fernando Jose Gonzalez Sierra <90760906+UO277938@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:13:39 +0200 Subject: [PATCH] Delete webapp/src/App.test.js --- webapp/src/App.test.js | 68 ------------------------------------------ 1 file changed, 68 deletions(-) delete mode 100644 webapp/src/App.test.js diff --git a/webapp/src/App.test.js b/webapp/src/App.test.js deleted file mode 100644 index 0c8f791..0000000 --- a/webapp/src/App.test.js +++ /dev/null @@ -1,68 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -/*test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/Welcome to the 2024 edition of the Software Architecture course/i); - expect(linkElement).toBeInTheDocument(); -}); -*/ - -describe('App', () => { - - it('renders login page when not logged in', () => { - render( - - - - ); - - expect(screen.getByText(/Login/i)).toBeInTheDocument(); - }); - - it('renders home page when logged in', () => { - // Mock local storage to simulate being logged in - const mockLocalStorage = { - getItem: jest.fn(() => 'true'), - setItem: jest.fn(), - clear: jest.fn() - }; - global.localStorage = mockLocalStorage; - - render( - - - - ); - - expect(screen.getByText(/Home/i)).toBeInTheDocument(); - }); - - it('redirects to login when trying to access stats page without logging in', () => { - render( - - - - ); - - expect(screen.getByText(/Login/i)).toBeInTheDocument(); - }); - - it('renders stats page when logged in and trying to access stats page', () => { - // Mock local storage to simulate being logged in - const mockLocalStorage = { - getItem: jest.fn(() => 'true'), - setItem: jest.fn(), - clear: jest.fn() - }; - global.localStorage = mockLocalStorage; - - render( - - - - ); - - expect(screen.getByText(/Estadisticas/i)).toBeInTheDocument(); - }); -}); \ No newline at end of file