Skip to content

Commit d0d9fb8

Browse files
committed
test [nfc]: Introduce eg.realmEmojiItem
Some bits of data change in the one existing test that was using these; but not any data that the test looks at.
1 parent 4f6ad02 commit d0d9fb8

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

test/example_data.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ GetServerSettingsResult serverSettings({
6262
);
6363
}
6464

65+
RealmEmojiItem realmEmojiItem({
66+
required String emojiCode,
67+
required String emojiName,
68+
String? sourceUrl,
69+
String? stillUrl,
70+
bool deactivated = false,
71+
int? authorId,
72+
}) {
73+
assert(RegExp(r'^[1-9][0-9]*$').hasMatch(emojiCode));
74+
return RealmEmojiItem(
75+
id: emojiCode,
76+
name: emojiName,
77+
sourceUrl: sourceUrl ?? '/emoji/$emojiCode.png',
78+
stillUrl: stillUrl,
79+
deactivated: deactivated,
80+
authorId: authorId ?? user().userId,
81+
);
82+
}
83+
6584
////////////////////////////////////////////////////////////////
6685
// Users and accounts.
6786
//

test/widgets/emoji_reaction_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ void main() {
167167
final users = [user1, user2, user3, user4, user5];
168168

169169
final realmEmoji = <String, RealmEmojiItem>{
170-
'181': RealmEmojiItem(id: '181', name: 'twocents', authorId: 7,
171-
deactivated: false, sourceUrl: '/foo/2', stillUrl: null),
172-
'182': RealmEmojiItem(id: '182', name: 'threecents', authorId: 7,
173-
deactivated: false, sourceUrl: '/foo/3', stillUrl: null),
170+
'181': eg.realmEmojiItem(emojiCode: '181', emojiName: 'twocents'),
171+
'182': eg.realmEmojiItem(emojiCode: '182', emojiName: 'threecents'),
174172
};
175173

176174
runSmokeTest('same reaction, different users, with one unknown user', [

0 commit comments

Comments
 (0)