feat(flutter): 完成 K28-A1 四 Tab 首页

This commit is contained in:
Zhou Weidong committed 2026-10-20 09:57:10 +08:00
1 parent f981f88e0d
commit 49f3e63ed0
25 files changed
+606 -689

No files matched your search

+22 -9
View File
@@ -84,6 +84,10 @@ void main() {
) async {
await tester.pumpWidget(appUnderTest());
await tester.pumpAndSettle();
await tester.ensureVisible(
find.byKey(const Key('home-drama-card-the-signal-demo')),
);
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('home-drama-card-the-signal-demo')));
await tester.pumpAndSettle();
@@ -172,7 +176,7 @@ void main() {
expect(tester.takeException(), isNull);
});
testWidgets('should_render_theater_with_filters_and_same_route_tabs', (
testWidgets('should_render_existing_theater_layout_on_same_route_tab', (
tester,
) async {
tester.view.physicalSize = const Size(360, 720);
@@ -185,15 +189,11 @@ void main() {
await tester.tap(find.byKey(const Key('tab-theater')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('discover-search')), findsOneWidget);
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
expect(find.byKey(const Key('theater-language-chips')), findsOneWidget);
expect(find.byKey(const Key('discover-category-grid')), findsOneWidget);
expect(find.byKey(const Key('discover-ranking-section')), findsOneWidget);
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
expect(find.byKey(const Key('discover-search-button')), findsOneWidget);
expect(find.byKey(const Key('discover-profile')), findsOneWidget);
expect(
find.byKey(const Key('home-drama-card-city-lights-demo')),
findsOneWidget,
);
expect(tester.takeException(), isNull);
});
@@ -287,7 +287,20 @@ void main() {
Future<void> _openTheaterPlayer(WidgetTester tester) async {
await tester.tap(find.byKey(const Key('tab-theater')));
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('home-drama-card-city-lights-demo')));
final card = find.byKey(const Key('home-drama-card-city-lights-demo'));
await tester.scrollUntilVisible(
card,
220,
scrollable: find
.descendant(
of: find.byKey(const Key('discover-refresh')),
matching: find.byType(Scrollable),
)
.first,
);
await tester.ensureVisible(card);
await tester.pumpAndSettle();
await tester.tap(card);
await tester.pumpAndSettle();
}