From 327efa2c04612ee345288264ac407184c86daf41 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 7 Dec 2024 23:11:04 -0800 Subject: [PATCH] emoji test: Avoid coincidentally using "popular" emoji We'll soon (for #1068) be adding logic that distinguishes these emoji from other Unicode emoji. That would break some test cases which refer to an emoji that happens to be "popular", like :smile:, when they really just intend the generic behavior that happens to any Unicode emoji. --- test/model/emoji_test.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/model/emoji_test.dart b/test/model/emoji_test.dart index 3a0ddc5e95..9d14a40b33 100644 --- a/test/model/emoji_test.dart +++ b/test/model/emoji_test.dart @@ -127,11 +127,11 @@ void main() { final store = prepare(realmEmoji: { '1': eg.realmEmojiItem(emojiCode: '1', emojiName: 'smiley'), }, unicodeEmoji: { - '1f642': ['smile'], + '1f516': ['bookmark'], '1f603': ['smiley'], }); check(store.allEmojiCandidates()).deepEquals([ - isUnicodeCandidate('1f642', ['smile']), + isUnicodeCandidate('1f516', ['bookmark']), isRealmCandidate(emojiCode: '1', emojiName: 'smiley'), isZulipCandidate(), ]); @@ -170,10 +170,10 @@ void main() { ]); store.setServerEmojiData(ServerEmojiData(codeToNames: { - '1f642': ['smile'], + '1f516': ['bookmark'], })); check(store.allEmojiCandidates()).deepEquals([ - isUnicodeCandidate('1f642', ['smile']), + isUnicodeCandidate('1f516', ['bookmark']), isZulipCandidate(), ]); }); @@ -197,7 +197,7 @@ void main() { final store = prepare(realmEmoji: { '1': eg.realmEmojiItem(emojiCode: '1', emojiName: 'happy'), }, unicodeEmoji: { - '1f642': ['smile'], + '1f516': ['bookmark'], }); final candidates = store.allEmojiCandidates(); check(store.allEmojiCandidates()).identicalTo(candidates); @@ -237,7 +237,7 @@ void main() { test('results can include all three emoji types', () async { final store = prepare( - realmEmoji: {'1': 'happy'}, unicodeEmoji: {'1f642': ['smile']}); + realmEmoji: {'1': 'happy'}, unicodeEmoji: {'1f516': ['bookmark']}); final view = EmojiAutocompleteView.init(store: store, query: EmojiAutocompleteQuery('')); bool done = false; @@ -245,7 +245,7 @@ void main() { await Future(() {}); check(done).isTrue(); check(view.results).deepEquals([ - isUnicodeResult(names: ['smile']), + isUnicodeResult(names: ['bookmark']), isRealmResult(emojiName: 'happy'), isZulipResult(), ]);