@@ -70,24 +70,6 @@ Future<void> setupPage(WidgetTester tester, {
70
70
await tester.pumpAndSettle ();
71
71
}
72
72
73
- CustomProfileField mkCustomProfileField (
74
- int id,
75
- CustomProfileFieldType type, {
76
- int ? order,
77
- bool ? displayInProfileSummary,
78
- String ? fieldData,
79
- }) {
80
- return CustomProfileField (
81
- id: id,
82
- type: type,
83
- order: order ?? id,
84
- name: 'field$id ' ,
85
- hint: 'hint$id ' ,
86
- fieldData: fieldData ?? '' ,
87
- displayInProfileSummary: displayInProfileSummary ?? false ,
88
- );
89
- }
90
-
91
73
void main () {
92
74
TestZulipBinding .ensureInitialized ();
93
75
@@ -153,16 +135,16 @@ void main() {
153
135
],
154
136
pageUserId: 1 ,
155
137
customProfileFields: [
156
- mkCustomProfileField (0 , CustomProfileFieldType .shortText),
157
- mkCustomProfileField (1 , CustomProfileFieldType .longText),
158
- mkCustomProfileField (2 , CustomProfileFieldType .choice,
138
+ eg. customProfileField (0 , CustomProfileFieldType .shortText),
139
+ eg. customProfileField (1 , CustomProfileFieldType .longText),
140
+ eg. customProfileField (2 , CustomProfileFieldType .choice,
159
141
fieldData: '{"x": {"text": "choiceValue", "order": "1"}}' ),
160
- mkCustomProfileField (3 , CustomProfileFieldType .date),
161
- mkCustomProfileField (4 , CustomProfileFieldType .link),
162
- mkCustomProfileField (5 , CustomProfileFieldType .user),
163
- mkCustomProfileField (6 , CustomProfileFieldType .externalAccount,
142
+ eg. customProfileField (3 , CustomProfileFieldType .date),
143
+ eg. customProfileField (4 , CustomProfileFieldType .link),
144
+ eg. customProfileField (5 , CustomProfileFieldType .user),
145
+ eg. customProfileField (6 , CustomProfileFieldType .externalAccount,
164
146
fieldData: '{"subtype": "external1"}' ),
165
- mkCustomProfileField (7 , CustomProfileFieldType .pronouns),
147
+ eg. customProfileField (7 , CustomProfileFieldType .pronouns),
166
148
], realmDefaultExternalAccounts: {
167
149
'external1' : RealmDefaultExternalAccount (
168
150
name: 'external1' ,
@@ -207,7 +189,7 @@ void main() {
207
189
await setupPage (tester,
208
190
users: [user],
209
191
pageUserId: user.userId,
210
- customProfileFields: [mkCustomProfileField (0 , CustomProfileFieldType .link)],
192
+ customProfileFields: [eg. customProfileField (0 , CustomProfileFieldType .link)],
211
193
);
212
194
213
195
await tester.tap (find.text (testUrl));
@@ -226,7 +208,7 @@ void main() {
226
208
users: [user],
227
209
pageUserId: user.userId,
228
210
customProfileFields: [
229
- mkCustomProfileField (0 , CustomProfileFieldType .externalAccount,
211
+ eg. customProfileField (0 , CustomProfileFieldType .externalAccount,
230
212
fieldData: '{"subtype": "external1"}' )
231
213
],
232
214
realmDefaultExternalAccounts: {
@@ -258,7 +240,7 @@ void main() {
258
240
await setupPage (tester,
259
241
users: users,
260
242
pageUserId: 1 ,
261
- customProfileFields: [mkCustomProfileField (0 , CustomProfileFieldType .user)],
243
+ customProfileFields: [eg. customProfileField (0 , CustomProfileFieldType .user)],
262
244
navigatorObserver: testNavObserver,
263
245
);
264
246
@@ -279,7 +261,7 @@ void main() {
279
261
await setupPage (tester,
280
262
users: users,
281
263
pageUserId: 1 ,
282
- customProfileFields: [mkCustomProfileField (0 , CustomProfileFieldType .user)],
264
+ customProfileFields: [eg. customProfileField (0 , CustomProfileFieldType .user)],
283
265
);
284
266
285
267
final textFinder = find.text ('(unknown user)' );
@@ -310,7 +292,7 @@ void main() {
310
292
users: users,
311
293
mutedUserIds: [2 ],
312
294
pageUserId: 1 ,
313
- customProfileFields: [mkCustomProfileField (0 , CustomProfileFieldType .user)]);
295
+ customProfileFields: [eg. customProfileField (0 , CustomProfileFieldType .user)]);
314
296
315
297
check (find.text ('Muted user' )).findsOne ();
316
298
check (mutedAvatarFinder (2 )).findsOne ();
@@ -335,7 +317,7 @@ void main() {
335
317
await setupPage (tester,
336
318
users: users,
337
319
pageUserId: 1 ,
338
- customProfileFields: [mkCustomProfileField (0 , CustomProfileFieldType .user)],
320
+ customProfileFields: [eg. customProfileField (0 , CustomProfileFieldType .user)],
339
321
);
340
322
341
323
final avatars = tester.widgetList <Avatar >(find.byType (Avatar ));
@@ -358,16 +340,16 @@ void main() {
358
340
359
341
await setupPage (tester, users: [user, user2], pageUserId: user.userId,
360
342
customProfileFields: [
361
- mkCustomProfileField (0 , CustomProfileFieldType .shortText),
362
- mkCustomProfileField (1 , CustomProfileFieldType .longText),
363
- mkCustomProfileField (2 , CustomProfileFieldType .choice,
343
+ eg. customProfileField (0 , CustomProfileFieldType .shortText),
344
+ eg. customProfileField (1 , CustomProfileFieldType .longText),
345
+ eg. customProfileField (2 , CustomProfileFieldType .choice,
364
346
fieldData: '{"x": {"text": "$longString ", "order": "1"}}' ),
365
347
// no [CustomProfileFieldType.date] because those can't be made long
366
- mkCustomProfileField (3 , CustomProfileFieldType .link),
367
- mkCustomProfileField (4 , CustomProfileFieldType .user),
368
- mkCustomProfileField (5 , CustomProfileFieldType .externalAccount,
348
+ eg. customProfileField (3 , CustomProfileFieldType .link),
349
+ eg. customProfileField (4 , CustomProfileFieldType .user),
350
+ eg. customProfileField (5 , CustomProfileFieldType .externalAccount,
369
351
fieldData: '{"subtype": "external1"}' ),
370
- mkCustomProfileField (6 , CustomProfileFieldType .pronouns),
352
+ eg. customProfileField (6 , CustomProfileFieldType .pronouns),
371
353
], realmDefaultExternalAccounts: {
372
354
'external1' : RealmDefaultExternalAccount (
373
355
name: 'external1' ,
0 commit comments