Skip to content

Commit df51b3f

Browse files
chrisbobbegnprice
authored andcommitted
test: Change '1f642': 'smile' emoji to 'slight_smile' where it appears
1 parent 34a562a commit df51b3f

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

test/api/route/realm_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void main() {
2222
}
2323

2424
final fakeResult = ServerEmojiData(codeToNames: {
25-
'1f642': ['smile'],
25+
'1f642': ['slight_smile'],
2626
'1f34a': ['orange', 'tangerine', 'mandarin'],
2727
});
2828

test/example_data.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ GetServerSettingsResult serverSettings({
132132
ServerEmojiData serverEmojiDataPopular = ServerEmojiData(codeToNames: {
133133
'1f44d': ['+1', 'thumbs_up', 'like'],
134134
'1f389': ['tada'],
135-
'1f642': ['smile'],
135+
'1f642': ['slight_smile'],
136136
'2764': ['heart', 'love', 'love_you'],
137137
'1f6e0': ['working_on_it', 'hammer_and_wrench', 'tools'],
138138
'1f419': ['octopus'],
@@ -151,15 +151,15 @@ ServerEmojiData serverEmojiDataPopularPlus(ServerEmojiData data) {
151151
return result;
152152
}
153153

154-
/// Like [serverEmojiDataPopular], but with the modern '1f642': ['slight_smile']
155-
/// instead of '1f642': ['smile']; see zulip/zulip@9feba0f16f.
154+
/// Like [serverEmojiDataPopular], but with the legacy '1f642': ['smile']
155+
/// instead of '1f642': ['slight_smile']; see zulip/zulip@9feba0f16f.
156156
///
157157
/// zulip/zulip@9feba0f16f is a Server 11 commit.
158-
// TODO(server-11) can drop legacy data
159-
ServerEmojiData serverEmojiDataPopularModern = ServerEmojiData(codeToNames: {
158+
// TODO(server-11) can drop this
159+
ServerEmojiData serverEmojiDataPopularLegacy = ServerEmojiData(codeToNames: {
160160
'1f44d': ['+1', 'thumbs_up', 'like'],
161161
'1f389': ['tada'],
162-
'1f642': ['slight_smile'],
162+
'1f642': ['smile'],
163163
'2764': ['heart', 'love', 'love_you'],
164164
'1f6e0': ['working_on_it', 'hammer_and_wrench', 'tools'],
165165
'1f419': ['octopus'],

test/model/emoji_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ void main() {
3131
group('emojiDisplayFor', () {
3232
test('Unicode emoji', () {
3333
check(eg.store().emojiDisplayFor(emojiType: ReactionType.unicodeEmoji,
34-
emojiCode: '1f642', emojiName: 'smile')
34+
emojiCode: '1f642', emojiName: 'slight_smile')
3535
).isA<UnicodeEmojiDisplay>()
36-
..emojiName.equals('smile')
36+
..emojiName.equals('slight_smile')
3737
..emojiUnicode.equals('🙂');
3838
});
3939

@@ -317,13 +317,13 @@ void main() {
317317
final candidates1 = store.popularEmojiCandidates();
318318
check(candidates1).isEmpty();
319319

320-
store.setServerEmojiData(eg.serverEmojiDataPopular);
320+
store.setServerEmojiData(eg.serverEmojiDataPopularLegacy);
321321
final candidates2 = store.popularEmojiCandidates();
322322
check(candidates2)
323323
..isNotEmpty()
324324
..not((it) => it.identicalTo(candidates1));
325325

326-
store.setServerEmojiData(eg.serverEmojiDataPopularModern);
326+
store.setServerEmojiData(eg.serverEmojiDataPopular);
327327
final candidates3 = store.popularEmojiCandidates();
328328
check(candidates3)
329329
..isNotEmpty()
@@ -418,7 +418,7 @@ void main() {
418418
check(await resultsOf('')).deepEquals([
419419
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
420420
isUnicodeResult(names: ['tada']),
421-
isUnicodeResult(names: ['smile']),
421+
isUnicodeResult(names: ['slight_smile']),
422422
isUnicodeResult(names: ['heart', 'love', 'love_you']),
423423
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
424424
isUnicodeResult(names: ['octopus']),
@@ -431,6 +431,7 @@ void main() {
431431
isUnicodeResult(names: ['tada']),
432432
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
433433
// other
434+
isUnicodeResult(names: ['slight_smile']),
434435
isUnicodeResult(names: ['heart', 'love', 'love_you']),
435436
isUnicodeResult(names: ['octopus']),
436437
]);
@@ -441,6 +442,7 @@ void main() {
441442
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
442443
// other
443444
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
445+
isUnicodeResult(names: ['slight_smile']),
444446
]);
445447
});
446448

test/model/store_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ void main() {
705705

706706
final emojiDataUrl = Uri.parse('https://cdn.example/emoji.json');
707707
final data = {
708-
'1f642': ['smile'],
708+
'1f642': ['slight_smile'],
709709
'1f34a': ['orange', 'tangerine', 'mandarin'],
710710
};
711711

test/widgets/action_sheet_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Future<void> setupToMessageActionSheet(WidgetTester tester, {
8282
connection = store.connection as FakeApiConnection;
8383
if (shouldSetServerEmojiData) {
8484
store.setServerEmojiData(useLegacyServerEmojiData
85-
? eg.serverEmojiDataPopular
86-
: eg.serverEmojiDataPopularModern);
85+
? eg.serverEmojiDataPopularLegacy
86+
: eg.serverEmojiDataPopular);
8787
}
8888

8989
connection.prepare(json: eg.newestGetMessagesResult(
@@ -849,8 +849,8 @@ void main() {
849849
final popularCandidates =
850850
(eg.store()..setServerEmojiData(
851851
useLegacy
852-
? eg.serverEmojiDataPopular
853-
: eg.serverEmojiDataPopularModern))
852+
? eg.serverEmojiDataPopularLegacy
853+
: eg.serverEmojiDataPopular))
854854
.popularEmojiCandidates();
855855
for (final emoji in popularCandidates) {
856856
final emojiDisplay = emoji.emojiDisplay as UnicodeEmojiDisplay;

test/widgets/emoji_reaction_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void main() {
161161
// Base JSON for various unicode emoji reactions. Just missing user_id.
162162
final u1 = {'emoji_name': '+1', 'emoji_code': '1f44d', 'reaction_type': 'unicode_emoji'};
163163
final u2 = {'emoji_name': 'family_man_man_girl_boy', 'emoji_code': '1f468-200d-1f468-200d-1f467-200d-1f466', 'reaction_type': 'unicode_emoji'};
164-
final u3 = {'emoji_name': 'smile', 'emoji_code': '1f642', 'reaction_type': 'unicode_emoji'};
164+
final u3 = {'emoji_name': 'slight_smile', 'emoji_code': '1f642', 'reaction_type': 'unicode_emoji'};
165165
final u4 = {'emoji_name': 'tada', 'emoji_code': '1f389', 'reaction_type': 'unicode_emoji'};
166166
final u5 = {'emoji_name': 'exploding_head', 'emoji_code': '1f92f', 'reaction_type': 'unicode_emoji'};
167167

@@ -239,7 +239,7 @@ void main() {
239239
await setupChipsInBox(tester, reactions: [
240240
Reaction.fromJson({
241241
'user_id': eg.selfUser.userId,
242-
'emoji_name': 'smile', 'emoji_code': '1f642', 'reaction_type': 'unicode_emoji'}),
242+
'emoji_name': 'slight_smile', 'emoji_code': '1f642', 'reaction_type': 'unicode_emoji'}),
243243
Reaction.fromJson({
244244
'user_id': eg.otherUser.userId,
245245
'emoji_name': 'tada', 'emoji_code': '1f389', 'reaction_type': 'unicode_emoji'}),
@@ -251,7 +251,7 @@ void main() {
251251
return material.color;
252252
}
253253

254-
check(backgroundColor('smile')).isNotNull()
254+
check(backgroundColor('slight_smile')).isNotNull()
255255
.isSameColorAs(EmojiReactionTheme.light.bgSelected);
256256
check(backgroundColor('tada')).isNotNull()
257257
.isSameColorAs(EmojiReactionTheme.light.bgUnselected);
@@ -261,13 +261,13 @@ void main() {
261261

262262
await tester.pump(kThemeAnimationDuration * 0.4);
263263
final expectedLerped = EmojiReactionTheme.light.lerp(EmojiReactionTheme.dark, 0.4);
264-
check(backgroundColor('smile')).isNotNull()
264+
check(backgroundColor('slight_smile')).isNotNull()
265265
.isSameColorAs(expectedLerped.bgSelected);
266266
check(backgroundColor('tada')).isNotNull()
267267
.isSameColorAs(expectedLerped.bgUnselected);
268268

269269
await tester.pump(kThemeAnimationDuration * 0.6);
270-
check(backgroundColor('smile')).isNotNull()
270+
check(backgroundColor('slight_smile')).isNotNull()
271271
.isSameColorAs(EmojiReactionTheme.dark.bgSelected);
272272
check(backgroundColor('tada')).isNotNull()
273273
.isSameColorAs(EmojiReactionTheme.dark.bgUnselected);

0 commit comments

Comments
 (0)