Skip to content

Commit e62e995

Browse files
committed
chore: removing unnecessary checks in gestures and tidy format
1 parent 2a48997 commit e62e995

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

lib/widgets/all_channels.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,11 @@ class AllChannelsListEntry extends StatelessWidget {
102102
padding: EdgeInsetsDirectional.only(start: 8, end: 4),
103103
child: GestureDetector(
104104
onTap: () {
105-
if (!hasContentAccess) {
106-
return;
107-
}
108105
Navigator.push(context, MessageListPage.buildRoute(
109106
context: context,
110107
narrow: ChannelNarrow(channel.streamId)));
111108
},
112109
onLongPress: () {
113-
if (!hasContentAccess) {
114-
return;
115-
}
116110
showChannelActionSheet(context, channelId: channel.streamId);
117111
},
118112
child: Row(spacing: 6, children: [

test/widgets/all_channels_test.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void main() {
210210
await setupAllChannelsPage(tester, channels: [eg.stream()]);
211211

212212
await tester.longPress(find.byType(AllChannelsListEntry));
213-
await tester.pumpAndSettle();
213+
await tester.pump();
214214
await transitionDurationObserver.pumpPastTransition(tester);
215215

216216
check(find.byType(BottomSheet)).findsOne();
@@ -219,15 +219,17 @@ void main() {
219219
testWidgets('navigate to channel feed on tap', (tester) async {
220220
final channel = eg.stream(name: 'some-channel');
221221
await setupAllChannelsPage(tester, channels: [channel]);
222+
222223
connection.prepare(json: eg.newestGetMessagesResult(
223224
foundOldest: true, messages: [eg.streamMessage(stream: channel)]).toJson());
225+
await tester.tap(find.byType(AllChannelsListEntry));
226+
await tester.pump();
227+
await transitionDurationObserver.pumpPastTransition(tester);
224228

225-
await tester.tap(find.byType(AllChannelsListEntry).at(0));
226-
await tester.pumpAndSettle();
227229
check(find.descendant(
228-
of: find.byType(MessageListPage),
229-
matching: find.text('some-channel')),
230-
).findsOne();
230+
of: find.byType(MessageListPage),
231+
matching: find.text('some-channel')),
232+
).findsOne();
231233
});
232234

233235
testWidgets('use toggle switch to subscribe/unsubscribe', (tester) async {

0 commit comments

Comments
 (0)