feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -129,13 +129,16 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('following-edit')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.byKey(const Key('following-remove-the-signal-demo')),
|
||||
find.byKey(const Key('following-select-the-signal-demo')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byKey(const Key('following-cancel-follow')), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('following-remove-the-signal-demo')));
|
||||
await tester.tap(find.byKey(const Key('following-card-the-signal-demo')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(AlertDialog), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('following-cancel-follow')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Unfollow the selected dramas?'), findsOneWidget);
|
||||
await tester.tap(
|
||||
find.descendant(
|
||||
of: find.byType(AlertDialog),
|
||||
@@ -145,7 +148,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.byKey(const Key('following-remove-the-signal-demo')),
|
||||
find.byKey(const Key('following-select-the-signal-demo')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byIcon(Icons.edit_outlined), findsOneWidget);
|
||||
@@ -159,6 +162,47 @@ void main() {
|
||||
expect(find.byKey(const Key('following-history-empty')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_unfollow_every_selected_drama_when_edit_confirms', (
|
||||
tester,
|
||||
) async {
|
||||
_signIn();
|
||||
final catalog = FakeCatalogRepository();
|
||||
final dramas = catalog.dramas.take(2).toList();
|
||||
final favorites = InMemoryFavoriteRepository(
|
||||
cards: dramas,
|
||||
saved: dramas.map((drama) => drama.id).toSet(),
|
||||
);
|
||||
await tester.pumpWidget(_app(catalog: catalog, favorites: favorites));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('tab-follow')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('following-edit')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const Key('following-select-all')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('following-cancel-follow')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(
|
||||
find.descendant(
|
||||
of: find.byType(AlertDialog),
|
||||
matching: find.byType(FilledButton),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.byKey(const Key('following-card-the-signal-demo')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.byKey(const Key('following-card-city-lights-demo')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byIcon(Icons.edit_outlined), findsOneWidget);
|
||||
expect(favorites.removeManyCalls, 1);
|
||||
});
|
||||
|
||||
testWidgets('should_show_auth_gate_when_signed_out', (tester) async {
|
||||
SharedPreferencesAsyncPlatform.instance =
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
|
||||
Reference in new issue
Block a user