Skip to content

Commit f200ff9

Browse files
committed
action_sheet test [nfc]: Have showFromAppBar take messages, not message
When we add the resolve/unresolve button, coming up, we'll use this to test the edge case where the button isn't shown in the message-list app bar if the message list is empty. (For that case we'll just pass an empty Iterable for this.)
1 parent 7921790 commit f200ff9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ void main() {
176176
Future<void> showFromAppBar(WidgetTester tester, {
177177
ZulipStream? channel,
178178
String topic = someTopic,
179-
StreamMessage? message,
179+
Iterable<StreamMessage>? messages,
180180
}) async {
181181
final effectiveChannel = channel ?? someChannel;
182-
final effectiveMessage = message ?? someMessage;
183-
assert(effectiveMessage.topic.apiName == topic);
182+
final effectiveMessages = messages ?? [someMessage];
183+
assert(effectiveMessages.every((m) => m.topic.apiName == topic));
184184

185185
connection.prepare(json: eg.newestGetMessagesResult(
186-
foundOldest: true, messages: [effectiveMessage]).toJson());
186+
foundOldest: true, messages: effectiveMessages.toList()).toJson());
187187
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
188188
child: MessageListPage(
189189
initNarrow: eg.topicNarrow(effectiveChannel.streamId, topic))));
@@ -288,7 +288,8 @@ void main() {
288288

289289
final message = eg.streamMessage(
290290
stream: someChannel, topic: topic, sender: eg.otherUser);
291-
await showFromAppBar(tester, channel: someChannel, topic: topic, message: message);
291+
await showFromAppBar(tester,
292+
channel: someChannel, topic: topic, messages: [message]);
292293
}
293294

294295
void checkButtons(List<Finder> expectedButtonFinders) {

0 commit comments

Comments
 (0)