navigate("/signup")} style={{ cursor: 'pointer' }}>You don´t have an account?
+
+
+ );
}
\ No newline at end of file
diff --git a/webapp/src/tests/Root.test.js b/webapp/src/tests/Root.test.js
new file mode 100644
index 00000000..554312bb
--- /dev/null
+++ b/webapp/src/tests/Root.test.js
@@ -0,0 +1,36 @@
+import React from 'react';
+import { render, screen, fireEvent, getByTestId } from '@testing-library/react';
+import { MemoryRouter, createMemoryRouter } from 'react-router';
+import Root from '../pages/Root';
+
+describe('Root component', () => {
+
+ it('renders WIQ-EN2B heading', () => {
+ render();
+ const headingElement = screen.getByText('WIQ-EN2B');
+ expect(headingElement).toBeInTheDocument();
+ });
+
+ it('renders welcome message', () => {
+ render();
+ const welcomeMessage = screen.getByText(/welcome to the WIQ-EN2B page/i);
+ expect(welcomeMessage).toBeInTheDocument();
+ });
+
+ it('renders Log In button', () => {
+ render();
+ expect(getByTestId(document.body, 'Login')).toBeInTheDocument();
+ });
+
+ it('navigates to /login when Log In button is clicked', () => {
+ const { container } = render();
+ fireEvent.click(getByTestId(document.body, 'Login'));
+ expect(container.innerHTML).toMatch('
WIQ-EN2B
Welcome to the WIQ-EN2B page
You don´t have an account?
');
+ });
+
+ it('navigates to /signup when "You don\'t have an account?" message is clicked', () => {
+ const { container } = render();
+ fireEvent.click(screen.getByText('You don´t have an account?'));
+ expect(container.innerHTML).toMatch('