Skip to content

Commit 076b689

Browse files
committed
test: Change '1f642': 'smile' emoji to 'slight_smile' where it appears
1 parent 1a40f27 commit 076b689

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
@@ -29,9 +29,9 @@ void main() {
2929
group('emojiDisplayFor', () {
3030
test('Unicode emoji', () {
3131
check(eg.store().emojiDisplayFor(emojiType: ReactionType.unicodeEmoji,
32-
emojiCode: '1f642', emojiName: 'smile')
32+
emojiCode: '1f642', emojiName: 'slight_smile')
3333
).isA<UnicodeEmojiDisplay>()
34-
..emojiName.equals('smile')
34+
..emojiName.equals('slight_smile')
3535
..emojiUnicode.equals('🙂');
3636
});
3737

@@ -315,13 +315,13 @@ void main() {
315315
final candidates1 = store.popularEmojiCandidates();
316316
check(candidates1).isEmpty();
317317

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

324-
store.setServerEmojiData(eg.serverEmojiDataPopularModern);
324+
store.setServerEmojiData(eg.serverEmojiDataPopular);
325325
final candidates3 = store.popularEmojiCandidates();
326326
check(candidates3)
327327
..isNotEmpty()
@@ -417,7 +417,7 @@ void main() {
417417
check(await resultsOf('')).deepEquals([
418418
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
419419
isUnicodeResult(names: ['tada']),
420-
isUnicodeResult(names: ['smile']),
420+
isUnicodeResult(names: ['slight_smile']),
421421
isUnicodeResult(names: ['heart', 'love', 'love_you']),
422422
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
423423
isUnicodeResult(names: ['octopus']),
@@ -430,6 +430,7 @@ void main() {
430430
isUnicodeResult(names: ['tada']),
431431
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
432432
// other
433+
isUnicodeResult(names: ['slight_smile']),
433434
isUnicodeResult(names: ['heart', 'love', 'love_you']),
434435
isUnicodeResult(names: ['octopus']),
435436
]);
@@ -440,6 +441,7 @@ void main() {
440441
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
441442
// other
442443
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
444+
isUnicodeResult(names: ['slight_smile']),
443445
]);
444446
});
445447

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
@@ -74,8 +74,8 @@ Future<void> setupToMessageActionSheet(WidgetTester tester, {
7474
connection = store.connection as FakeApiConnection;
7575
if (shouldSetServerEmojiData) {
7676
store.setServerEmojiData(useLegacyServerEmojiData
77-
? eg.serverEmojiDataPopular
78-
: eg.serverEmojiDataPopularModern);
77+
? eg.serverEmojiDataPopularLegacy
78+
: eg.serverEmojiDataPopular);
7979
}
8080

8181
connection.prepare(json: eg.newestGetMessagesResult(
@@ -830,8 +830,8 @@ void main() {
830830
final popularCandidates =
831831
(eg.store()..setServerEmojiData(
832832
useLegacy
833-
? eg.serverEmojiDataPopular
834-
: eg.serverEmojiDataPopularModern))
833+
? eg.serverEmojiDataPopularLegacy
834+
: eg.serverEmojiDataPopular))
835835
.popularEmojiCandidates();
836836
for (final emoji in popularCandidates) {
837837
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)