mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix retained activity detail filtering
Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -378,6 +378,9 @@ class ActivityPage extends HookConsumerWidget {
|
||||
draftCount: drafts.length,
|
||||
onChanged: (nextFilter) {
|
||||
filter.value = nextFilter;
|
||||
selectedItemId.value = null;
|
||||
selectedItemTarget.value = null;
|
||||
selectedItemForDetail.value = null;
|
||||
},
|
||||
),
|
||||
_InboxOptionsButton(
|
||||
|
||||
@@ -316,6 +316,46 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('clears a retained wide detail when its filter changes', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1180, 820);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(() {
|
||||
tester.view.resetPhysicalSize();
|
||||
tester.view.resetDevicePixelRatio();
|
||||
});
|
||||
|
||||
await tester.pumpWidget(
|
||||
await buildTestable(
|
||||
feed: HomeFeedResponse(
|
||||
mentions: [testMention],
|
||||
needsAction: const [],
|
||||
activity: const [],
|
||||
agentActivity: const [],
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('inbox-row-m1')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ChannelDetailPage), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('activity-options-menu')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Show unread'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ChannelDetailPage), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('activity-filter-menu')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Reminders'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(ChannelDetailPage), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('keeps footer clearance inside the scrollable content', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user