Skip to content

Commit f3023a2

Browse files
committed
test: Change '1f642': 'smile' emoji to 'slight_smile' where it appears
1 parent 38fd31d commit f3023a2

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
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
@@ -118,7 +118,7 @@ GetServerSettingsResult serverSettings({
118118
ServerEmojiData serverEmojiDataPopular = ServerEmojiData(codeToNames: {
119119
'1f44d': ['+1', 'thumbs_up', 'like'],
120120
'1f389': ['tada'],
121-
'1f642': ['smile'],
121+
'1f642': ['slight_smile'],
122122
'2764': ['heart', 'love', 'love_you'],
123123
'1f6e0': ['working_on_it', 'hammer_and_wrench', 'tools'],
124124
'1f419': ['octopus'],
@@ -137,15 +137,15 @@ ServerEmojiData serverEmojiDataPopularPlus(ServerEmojiData data) {
137137
return result;
138138
}
139139

140-
/// Like [serverEmojiDataPopular], but with the modern '1f642': ['slight_smile']
141-
/// instead of '1f642': ['smile']; see zulip/zulip@9feba0f16f.
140+
/// Like [serverEmojiDataPopular], but with the legacy '1f642': ['smile']
141+
/// instead of '1f642': ['slight_smile']; see zulip/zulip@9feba0f16f.
142142
///
143143
/// zulip/zulip@9feba0f16f is a Server 11 commit.
144-
// TODO(server-11) can drop legacy data
145-
ServerEmojiData serverEmojiDataPopularModern = ServerEmojiData(codeToNames: {
144+
// TODO(server-11) can drop this
145+
ServerEmojiData serverEmojiDataPopularLegacy = ServerEmojiData(codeToNames: {
146146
'1f44d': ['+1', 'thumbs_up', 'like'],
147147
'1f389': ['tada'],
148-
'1f642': ['slight_smile'],
148+
'1f642': ['smile'],
149149
'2764': ['heart', 'love', 'love_you'],
150150
'1f6e0': ['working_on_it', 'hammer_and_wrench', 'tools'],
151151
'1f419': ['octopus'],

test/model/emoji_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ void main() {
1313
group('emojiDisplayFor', () {
1414
test('Unicode emoji', () {
1515
check(eg.store().emojiDisplayFor(emojiType: ReactionType.unicodeEmoji,
16-
emojiCode: '1f642', emojiName: 'smile')
16+
emojiCode: '1f642', emojiName: 'slight_smile')
1717
).isA<UnicodeEmojiDisplay>()
18-
..emojiName.equals('smile')
18+
..emojiName.equals('slight_smile')
1919
..emojiUnicode.equals('🙂');
2020
});
2121

@@ -398,7 +398,7 @@ void main() {
398398
check(await resultsOf('')).deepEquals([
399399
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
400400
isUnicodeResult(names: ['tada']),
401-
isUnicodeResult(names: ['smile']),
401+
isUnicodeResult(names: ['slight_smile']),
402402
isUnicodeResult(names: ['heart', 'love', 'love_you']),
403403
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
404404
isUnicodeResult(names: ['octopus']),
@@ -411,6 +411,7 @@ void main() {
411411
isUnicodeResult(names: ['tada']),
412412
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
413413
// other
414+
isUnicodeResult(names: ['slight_smile']),
414415
isUnicodeResult(names: ['heart', 'love', 'love_you']),
415416
isUnicodeResult(names: ['octopus']),
416417
]);
@@ -421,6 +422,7 @@ void main() {
421422
isUnicodeResult(names: ['working_on_it', 'hammer_and_wrench', 'tools']),
422423
// other
423424
isUnicodeResult(names: ['+1', 'thumbs_up', 'like']),
425+
isUnicodeResult(names: ['slight_smile']),
424426
]);
425427
});
426428

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
@@ -72,8 +72,8 @@ Future<void> setupToMessageActionSheet(WidgetTester tester, {
7272
}
7373
connection = store.connection as FakeApiConnection;
7474
store.setServerEmojiData(useLegacy
75-
? eg.serverEmojiDataPopular
76-
: eg.serverEmojiDataPopularModern);
75+
? eg.serverEmojiDataPopularLegacy
76+
: eg.serverEmojiDataPopular);
7777

7878
connection.prepare(json: eg.newestGetMessagesResult(
7979
foundOldest: true, messages: [message]).toJson());
@@ -819,8 +819,8 @@ void main() {
819819
final popularCandidates =
820820
(eg.store()..setServerEmojiData(
821821
useLegacy
822-
? eg.serverEmojiDataPopular
823-
: eg.serverEmojiDataPopularModern))
822+
? eg.serverEmojiDataPopularLegacy
823+
: eg.serverEmojiDataPopular))
824824
.popularEmojiCandidates();
825825
for (final emoji in popularCandidates) {
826826
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)