feat(flutter): 精简首页标题并重做空态视觉
This commit is contained in:
1 parent
b5a8656ff0
commit
2dd4627bdc
5 files changed
+127
-63
No files matched your search
@@ -37,13 +37,24 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Continue Watching'), findsNothing);
|
||||
expect(find.text('All Dramas'), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-all-dramas-title')), findsNothing);
|
||||
expect(find.text('All'), findsOneWidget);
|
||||
expect(find.text('For You'), findsNothing);
|
||||
expect(
|
||||
tester.getCenter(find.text('All')).dx,
|
||||
lessThan(tester.getCenter(find.text('Hot')).dx),
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
.getTopLeft(
|
||||
find.byKey(const Key('home-drama-card-the-signal-demo')),
|
||||
)
|
||||
.dy -
|
||||
tester
|
||||
.getBottomLeft(find.byKey(const Key('home-category-chips')))
|
||||
.dy,
|
||||
closeTo(14, 0.1),
|
||||
);
|
||||
|
||||
final grid = tester.widget<SliverGrid>(
|
||||
find.byKey(const Key('home-all-dramas-grid')),
|
||||
@@ -135,7 +146,7 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('tab-discover')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('All Dramas'), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-all-dramas-title')), findsNothing);
|
||||
expect(find.text('No matching dramas.'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('Romance'));
|
||||
@@ -154,7 +165,7 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('tab-discover')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('All Dramas'), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-all-dramas-title')), findsNothing);
|
||||
expect(find.text('Categories could not be loaded.'), findsOneWidget);
|
||||
expect(find.text('Retry'), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-all-dramas-grid')), findsNothing);
|
||||
@@ -176,7 +187,7 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('All Dramas'), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-all-dramas-title')), findsNothing);
|
||||
expect(find.text('City Lights & Velvet Nights'), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user