Skip to content

Commit 4498df6

Browse files
committed
action_sheet test [nfc]: Simplify some setup by using someChannel
Which is given the value `eg.stream()`, too, anyway.
1 parent 1991556 commit 4498df6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ void main() {
212212
});
213213

214214
group('UserTopicUpdateButton', () {
215-
late ZulipStream channel;
216215
late String topic;
217216

218217
final mute = find.text('Mute topic');
@@ -231,10 +230,9 @@ void main() {
231230
}) async {
232231
addTearDown(testBinding.reset);
233232

234-
channel = eg.stream();
235233
topic = 'isChannelMuted: $isChannelMuted, policy: $visibilityPolicy';
236234
await prepare(
237-
channel: channel,
235+
channel: someChannel,
238236
topic: topic,
239237
isChannelSubscribed: isChannelMuted != null, // shorthand; see dartdoc
240238
isChannelMuted: isChannelMuted,
@@ -243,12 +241,12 @@ void main() {
243241
);
244242

245243
final message = eg.streamMessage(
246-
stream: channel, topic: topic, sender: eg.otherUser);
244+
stream: someChannel, topic: topic, sender: eg.otherUser);
247245
connection.prepare(json: eg.newestGetMessagesResult(
248246
foundOldest: true, messages: [message]).toJson());
249247
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
250248
child: MessageListPage(
251-
initNarrow: eg.topicNarrow(channel.streamId, topic))));
249+
initNarrow: eg.topicNarrow(someChannel.streamId, topic))));
252250
await tester.pumpAndSettle();
253251

254252
await tester.longPress(find.descendant(
@@ -275,7 +273,7 @@ void main() {
275273
check(connection.lastRequest).isA<http.Request>()
276274
..url.path.equals('/api/v1/user_topics')
277275
..bodyFields.deepEquals({
278-
'stream_id': '${channel.streamId}',
276+
'stream_id': '${someChannel.streamId}',
279277
'topic': topic,
280278
'visibility_policy': jsonEncode(expectedPolicy),
281279
});

0 commit comments

Comments
 (0)