test: add responsive tests to all page test files

Add shared screen size constants and configureScreenSize() helper in
test/harness/screen_sizes.dart. Add responsive test groups to all page
tests covering desktop (1920x1080), tablet landscape (1024x768), tablet
portrait (768x1024), mobile (375x812), and small mobile (320x568).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-01-06 19:45:32 +01:00
co-authored by Claude Opus 4.5
parent 71eaccce67
commit ea6914b5f4
8 changed files with 514 additions and 4 deletions
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:tatlock_ui/features/security/groups/groups_list_page.dart';
import '../../../harness/screen_sizes.dart';
import '../../../harness/test_harness.dart';
void main() {
@@ -229,4 +230,62 @@ void main() {
}
});
});
group('GroupsListPage Responsive', () {
testWidgets('renders at desktop size (1920x1080)', (tester) async {
configureScreenSize(tester, ScreenSizes.desktopLarge);
harness.givenAuthenticatedUser();
harness.givenGroups();
await tester.pumpWidget(harness.wrap(const GroupsListPage()));
await tester.pumpAndSettle();
expect(find.text('admins'), findsOneWidget);
expect(find.byType(TextField), findsOneWidget);
});
testWidgets('renders at tablet landscape (1024x768)', (tester) async {
configureScreenSize(tester, ScreenSizes.tabletLandscape);
harness.givenAuthenticatedUser();
harness.givenGroups();
await tester.pumpWidget(harness.wrap(const GroupsListPage()));
await tester.pumpAndSettle();
expect(find.text('admins'), findsOneWidget);
});
testWidgets('renders at tablet portrait (768x1024)', (tester) async {
configureScreenSize(tester, ScreenSizes.tabletPortrait);
harness.givenAuthenticatedUser();
harness.givenGroups();
await tester.pumpWidget(harness.wrap(const GroupsListPage()));
await tester.pumpAndSettle();
expect(find.byType(GroupsListPage), findsOneWidget);
});
testWidgets('renders at mobile size (375x812)', (tester) async {
configureScreenSize(tester, ScreenSizes.mobile);
harness.givenAuthenticatedUser();
harness.givenGroups();
await tester.pumpWidget(harness.wrap(const GroupsListPage()));
await tester.pumpAndSettle();
expect(find.byType(GroupsListPage), findsOneWidget);
});
testWidgets('renders at small mobile size (320x568)', (tester) async {
configureScreenSize(tester, ScreenSizes.mobileSmall);
harness.givenAuthenticatedUser();
harness.givenGroups();
await tester.pumpWidget(harness.wrap(const GroupsListPage()));
await tester.pumpAndSettle();
expect(find.byType(GroupsListPage), findsOneWidget);
});
});
}