Skip to content

Commit ce5b0d3

Browse files
committed
test: In eg.account use deliveryEmail or generate one, not user.email
This way we avoid using a source that in real data would be guaranteed to be a fake email address: namely `user.email` for a user where `user.deliveryEmail` is null.
1 parent 0c9bf6f commit ce5b0d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/example_data.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,14 @@ Account account({
154154
String? ackedPushToken,
155155
}) {
156156
_checkPositive(id, 'account ID');
157+
// When `user.deliveryEmail` is null, using `user.email`
158+
// wouldn't be realistic: it's going to be a fake email address
159+
// generated to serve as a "Zulip API email".
160+
final email = user.deliveryEmail ?? _nextEmail();
157161
return Account(
158162
id: id ?? 1000, // TODO generate example IDs
159163
realmUrl: realmUrl ?? _realmUrl,
160-
email: user.email,
164+
email: email,
161165
apiKey: apiKey ?? 'aeouasdf',
162166
userId: user.userId,
163167
zulipFeatureLevel: zulipFeatureLevel ?? recentZulipFeatureLevel,

0 commit comments

Comments
 (0)