Redesign complete. Not much UI changes

This commit is contained in:
AG
2025-10-11 19:10:58 +03:00
parent 9bbd690f40
commit f42bac001d
20 changed files with 425 additions and 64 deletions

View File

@@ -0,0 +1,29 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from '../src/App';
describe('App responsiveness and branding', () => {
it('renders without crashing and displays app name', () => {
render(<App />);
expect(screen.getByText(/Unisono/i)).toBeInTheDocument();
});
// Placeholder for logo/favicon tests (more complex, often involves DOM inspection or browser APIs)
it('should display the app logo (placeholder)', () => {
render(<App />);
// In a real scenario, you'd check for an <img> tag within the AppBar or a specific data-testid
// For now, we'll assume the presence of the AppBar implies branding elements are handled.
expect(screen.getByRole('banner')).toBeInTheDocument(); // Checks for AppBar
});
// Placeholder for responsive tests
it('should adapt layout for mobile view', () => {
// Simulate mobile viewport and check for specific layout changes
// Example: expect(screen.getByTestId('mobile-nav')).toBeInTheDocument();
});
// Placeholder for touch functionality tests
it('should handle touch events correctly', () => {
// Simulate touch events and verify component behavior
});
});

View File

@@ -0,0 +1,20 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import CreateSession from '../src/pages/CreateSession';
describe('CreateSession responsiveness and touch functionality', () => {
it('renders without crashing', () => {
render(<CreateSession />);
// Add assertions specific to CreateSession page
});
// Placeholder for responsive tests
it('should adapt layout for mobile view', () => {
// Simulate mobile viewport and check for specific layout changes
});
// Placeholder for touch functionality tests
it('should handle touch events correctly', () => {
// Simulate touch events and verify component behavior
});
});

View File

@@ -0,0 +1,38 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import DesireForm from '../src/components/DesireForm';
describe('DesireForm functionality and readability', () => {
it('renders without crashing', () => {
render(<DesireForm />);
// Add assertions specific to DesireForm
});
it('should not use placeholders in input fields', () => {
render(<DesireForm />);
// Check that the TextField components do not have a 'placeholder' attribute
// Material-UI TextField uses 'label' which acts as a placeholder, but FR-011 is about not using the 'placeholder' HTML attribute.
// Since we removed the 'label' prop and moved content to helperText, this test will verify that.
expect(screen.queryByPlaceholderText(/List items you want/i)).not.toBeInTheDocument();
expect(screen.queryByPlaceholderText(/List items you accept/i)).not.toBeInTheDocument();
expect(screen.queryByPlaceholderText(/List items you absolutely do not want/i)).not.toBeInTheDocument();
});
it('should display validation rules as field description under the field', () => {
render(<DesireForm />);
// Check for helperText content
expect(screen.getByText(/Enter items you want, one per line. Max 500 characters per item./i)).toBeInTheDocument();
expect(screen.getByText(/Enter items you accept, one per line. Max 500 characters per item./i)).toBeInTheDocument();
expect(screen.getByText(/Enter items you absolutely do not want, one per line. Max 500 characters per item./i)).toBeInTheDocument();
});
// Placeholder for responsive tests
it('should adapt layout for mobile view', () => {
// Simulate mobile viewport and check for specific layout changes
});
// Placeholder for touch functionality tests
it('should handle touch events correctly', () => {
// Simulate touch events and verify component behavior
});
});

View File

@@ -0,0 +1,20 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import ResultsDisplay from '../src/components/ResultsDisplay';
describe('ResultsDisplay responsiveness and touch functionality', () => {
it('renders without crashing', () => {
render(<ResultsDisplay />);
// Add assertions specific to ResultsDisplay
});
// Placeholder for responsive tests
it('should adapt layout for mobile view', () => {
// Simulate mobile viewport and check for specific layout changes
});
// Placeholder for touch functionality tests
it('should handle touch events correctly', () => {
// Simulate touch events and verify component behavior
});
});

View File

@@ -0,0 +1,43 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import SessionPage from '../src/pages/SessionPage';
describe('SessionPage functionality and readability', () => {
it('renders without crashing', () => {
render(<SessionPage />);
// Add assertions specific to SessionPage
});
it('should not display "Session:" prefix for the session topic', () => {
render(<SessionPage />);
// Assuming a session topic is present, verify "Session:" is not in the document
expect(screen.queryByText(/Session: /i)).not.toBeInTheDocument();
});
it('should not use placeholders in input fields and display validation rules', () => {
render(<SessionPage />);
// Check for TextField in SETUP state
// Assuming the component is in SETUP state for this test
// For 'Session Topic' TextField
expect(screen.queryByPlaceholderText(/Session Topic/i)).not.toBeInTheDocument();
// For 'Number of Expected Responses' TextField
expect(screen.queryByPlaceholderText(/Number of Expected Responses/i)).not.toBeInTheDocument();
// Add checks for helperText if validation rules are added to these fields
});
it('should hide the session status display', () => {
render(<SessionPage />);
// Verify that the element displaying "Status:" is not in the document
expect(screen.queryByText(/Status:/i)).not.toBeInTheDocument();
});
// Placeholder for responsive tests
it('should adapt layout for mobile view', () => {
// Simulate mobile viewport and check for specific layout changes
});
// Placeholder for touch functionality tests
it('should handle touch events correctly', () => {
// Simulate touch events and verify component behavior
});
});