Skip to content

Commit fdd9624

Browse files
committed
test: Add stream helper in example data
1 parent a16a11f commit fdd9624

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/example_data.dart

+30
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,36 @@ final Account otherAccount = Account(
5757

5858
final User thirdUser = user(fullName: 'Third User', email: 'third@example', userId: 345);
5959

60+
ZulipStream stream({
61+
int? streamId,
62+
String? name,
63+
String? description,
64+
String? renderedDescription,
65+
int? dateCreated,
66+
int? firstMessageId,
67+
bool? inviteOnly,
68+
bool? isWebPublic,
69+
bool? historyPublicToSubscribers,
70+
int? messageRetentionDays,
71+
int? streamPostPolicy,
72+
int? canRemoveSubscribersGroupId,
73+
}) {
74+
return ZulipStream(
75+
streamId: streamId ?? 123, // TODO generate example IDs
76+
name: name ?? 'A stream', // TODO generate example names
77+
description: description ?? 'A description', // TODO generate example descriptions
78+
renderedDescription: renderedDescription ?? '<p>A description</p>', // TODO generate random
79+
dateCreated: dateCreated ?? 1686774898,
80+
firstMessageId: firstMessageId,
81+
inviteOnly: inviteOnly ?? false,
82+
isWebPublic: isWebPublic ?? false,
83+
historyPublicToSubscribers: historyPublicToSubscribers ?? true,
84+
messageRetentionDays: messageRetentionDays,
85+
streamPostPolicy: streamPostPolicy ?? 1,
86+
canRemoveSubscribersGroupId: canRemoveSubscribersGroupId ?? 123,
87+
);
88+
}
89+
6090
final _messagePropertiesBase = {
6191
'is_me_message': false,
6292
'last_edit_timestamp': null,

0 commit comments

Comments
 (0)