Skip to content

Commit 59c53ca

Browse files
committed
test: Add subscription helper in example data
1 parent 259ef24 commit 59c53ca

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/example_data.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,51 @@ ZulipStream stream({
123123
}
124124
const _stream = stream;
125125

126+
Subscription subscription({
127+
required ZulipStream stream,
128+
bool? desktopNotifications,
129+
bool? emailNotifications,
130+
bool? wildcardMentionsNotify,
131+
bool? pushNotifications,
132+
bool? audibleNotifications,
133+
bool? pinToTop,
134+
String? emailAddress,
135+
bool? isMuted,
136+
bool? isWebPublic,
137+
String? color,
138+
int? streamPostPolicy,
139+
int? messageRetentionDays,
140+
bool? historyPublicToSubscribers,
141+
int? firstMessageId,
142+
int? streamWeeklyTraffic,
143+
int? canRemoveSubscribersGroupId,
144+
}) {
145+
return Subscription(
146+
streamId: stream.streamId,
147+
name: stream.name,
148+
description: stream.description,
149+
renderedDescription: stream.renderedDescription,
150+
dateCreated: stream.dateCreated,
151+
inviteOnly: stream.inviteOnly,
152+
desktopNotifications: desktopNotifications ?? true,
153+
emailNotifications: emailNotifications ?? true,
154+
wildcardMentionsNotify: wildcardMentionsNotify ?? true,
155+
pushNotifications: pushNotifications ?? true,
156+
audibleNotifications: audibleNotifications ?? true,
157+
pinToTop: pinToTop ?? true,
158+
emailAddress: emailAddress ?? '[email protected]', // TODO generate example data
159+
isMuted: isMuted ?? true,
160+
isWebPublic: isWebPublic ?? true,
161+
color: color ?? '#e79ab5',
162+
streamPostPolicy: streamPostPolicy ?? 1,
163+
messageRetentionDays: messageRetentionDays ?? 365,
164+
historyPublicToSubscribers: historyPublicToSubscribers ?? true,
165+
firstMessageId: firstMessageId ?? 123, // TODO generate example data
166+
streamWeeklyTraffic: streamWeeklyTraffic ?? 100, // TODO generate example data
167+
canRemoveSubscribersGroupId: canRemoveSubscribersGroupId ?? 123 // TODO generate example data
168+
);
169+
}
170+
126171
////////////////////////////////////////////////////////////////
127172
// Messages, and pieces of messages.
128173
//

0 commit comments

Comments
 (0)