feat(ui): redesign landing page search and empty states
- Hide empty state placeholder on initial load - Add prominent hero mode to FilterBar when no search is active - Fix SchoolCard test TypeScript and assertion errors
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
* SchoolCard Component Tests
|
||||
*/
|
||||
|
||||
import '@testing-library/jest-dom';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { SchoolCard } from '@/components/SchoolCard';
|
||||
import type { School } from '@/lib/types';
|
||||
|
||||
const mockSchool: School = {
|
||||
const mockSchool = {
|
||||
urn: 100001,
|
||||
school_name: 'Test Primary School',
|
||||
local_authority: 'Westminster',
|
||||
@@ -16,9 +17,8 @@ const mockSchool: School = {
|
||||
latitude: 51.5074,
|
||||
longitude: -0.1278,
|
||||
rwm_expected_pct: 75.5,
|
||||
rwm_higher_pct: 25.3,
|
||||
prev_rwm_expected_pct: 70.0,
|
||||
};
|
||||
} as School;
|
||||
|
||||
describe('SchoolCard', () => {
|
||||
it('renders school information correctly', () => {
|
||||
@@ -58,6 +58,6 @@ describe('SchoolCard', () => {
|
||||
render(<SchoolCard school={mockSchool} />);
|
||||
|
||||
// Should show upward trend (75.5 > 70.0)
|
||||
expect(screen.getByText('↗')).toBeInTheDocument();
|
||||
expect(screen.getByTitle('Previous year: 70.0%')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user