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:
co-authored by
Claude Opus 4.5
parent
71eaccce67
commit
ea6914b5f4
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user