Skip to content

Commit 1dc1808

Browse files
committed
action_sheet test [nfc]: Add subscription-related params to a prepare
For the sake of some new callers when we move this function definition to an outer scope.
1 parent 1e8c916 commit 1dc1808

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/widgets/action_sheet_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,23 @@ void main() {
117117
Future<void> prepare({
118118
ZulipStream? channel,
119119
String topic = someTopic,
120+
bool isChannelSubscribed = true,
121+
bool? isChannelMuted,
120122
UnreadMessagesSnapshot? unreadMsgs,
121123
int? zulipFeatureLevel,
122124
}) async {
123125
final effectiveChannel = channel ?? someChannel;
126+
assert(isChannelSubscribed || isChannelMuted == null);
124127

125128
addTearDown(testBinding.reset);
126129

127130
final account = eg.selfAccount.copyWith(zulipFeatureLevel: zulipFeatureLevel);
128131
await testBinding.globalStore.add(account, eg.initialSnapshot(
129132
realmUsers: [eg.selfUser, eg.otherUser],
130133
streams: [effectiveChannel],
131-
subscriptions: [eg.subscription(effectiveChannel)],
134+
subscriptions: isChannelSubscribed
135+
? [eg.subscription(effectiveChannel, isMuted: isChannelMuted ?? false)]
136+
: null,
132137
unreadMsgs: unreadMsgs,
133138
zulipFeatureLevel: zulipFeatureLevel));
134139
store = await testBinding.globalStore.perAccount(eg.selfAccount.id);

0 commit comments

Comments
 (0)