Skip to content

Commit 74a1f48

Browse files
committed
action_sheet test [nfc]: Pull out someMessage variable
1 parent cdbd967 commit 74a1f48

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ void main() {
110110
group('topic action sheet', () {
111111
final someChannel = eg.stream();
112112
const someTopic = 'my topic';
113+
final someMessage = eg.streamMessage(
114+
stream: someChannel, topic: someTopic, sender: eg.otherUser);
113115

114116
group('showTopicActionSheet', () {
115-
final message = eg.streamMessage(
116-
stream: someChannel, topic: someTopic, sender: eg.otherUser);
117-
118117
Future<void> prepare({
119118
ZulipStream? channel,
120119
String topic = someTopic,
@@ -151,7 +150,7 @@ void main() {
151150
channels: [eg.unreadChannelMsgs(
152151
streamId: someChannel.streamId,
153152
topic: someTopic,
154-
unreadMessageIds: [message.id],
153+
unreadMessageIds: [someMessage.id],
155154
)]));
156155
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
157156
child: const HomePage()));
@@ -167,7 +166,7 @@ void main() {
167166
testWidgets('show from app bar', (tester) async {
168167
await prepare();
169168
connection.prepare(json: eg.newestGetMessagesResult(
170-
foundOldest: true, messages: [message]).toJson());
169+
foundOldest: true, messages: [someMessage]).toJson());
171170
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
172171
child: MessageListPage(
173172
initNarrow: eg.topicNarrow(someChannel.streamId, someTopic))));
@@ -186,7 +185,7 @@ void main() {
186185
testWidgets('show from recipient header', (tester) async {
187186
await prepare();
188187
connection.prepare(json: eg.newestGetMessagesResult(
189-
foundOldest: true, messages: [message]).toJson());
188+
foundOldest: true, messages: [someMessage]).toJson());
190189
await tester.pumpWidget(TestZulipApp(accountId: eg.selfAccount.id,
191190
child: const MessageListPage(initNarrow: CombinedFeedNarrow())));
192191
// global store, per-account store, and message list get loaded

0 commit comments

Comments
 (0)