Skip to content

Commit 55fdfd3

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 faed229 commit 55fdfd3

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
@@ -173,14 +173,14 @@ void main() {
173173
Future<void> showFromAppBar(WidgetTester tester, {
174174
ZulipStream? channel,
175175
String topic = someTopic,
176-
StreamMessage? message,
176+
List<StreamMessage>? messages,
177177
}) async {
178178
final effectiveChannel = channel ?? someChannel;
179-
final effectiveMessage = message ?? someMessage;
180-
assert(effectiveMessage.topic.apiName == topic);
179+
final effectiveMessages = messages ?? [someMessage];
180+
assert(effectiveMessages.every((m) => m.topic.apiName == topic));
181181

182182
connection.prepare(json: eg.newestGetMessagesResult(
183-
foundOldest: true, messages: [effectiveMessage]).toJson());
183+
foundOldest: true, messages: effectiveMessages).toJson());
184184
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
185185
child: MessageListPage(
186186
initNarrow: eg.topicNarrow(effectiveChannel.streamId, topic))));
@@ -284,7 +284,8 @@ void main() {
284284

285285
final message = eg.streamMessage(
286286
stream: someChannel, topic: topic, sender: eg.otherUser);
287-
await showFromAppBar(tester, channel: someChannel, topic: topic, message: message);
287+
await showFromAppBar(tester,
288+
channel: someChannel, topic: topic, messages: [message]);
288289
}
289290

290291
void checkButtons(List<Finder> expectedButtonFinders) {

0 commit comments

Comments
 (0)