diff --git a/src/CONST.ts b/src/CONST.ts index f50914aab5fc..c5d1446d9aa5 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1123,8 +1123,6 @@ const CONST = { // around each header. EMOJI_NUM_PER_ROW: 8, - EMOJI_FREQUENT_ROW_COUNT: 3, - EMOJI_DEFAULT_SKIN_TONE: -1, // Amount of emojis to render ahead at the end of the update cycle diff --git a/src/libs/API/parameters/UpdateFrequentlyUsedEmojisParams.ts b/src/libs/API/parameters/UpdateFrequentlyUsedEmojisParams.ts deleted file mode 100644 index f790ada3aad9..000000000000 --- a/src/libs/API/parameters/UpdateFrequentlyUsedEmojisParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -type UpdateFrequentlyUsedEmojisParams = {value: string}; - -export default UpdateFrequentlyUsedEmojisParams; diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts index 962056d9484a..ff62d9b69ea6 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -64,7 +64,6 @@ export type {default as UpdateAutomaticTimezoneParams} from './UpdateAutomaticTi export type {default as UpdateChatPriorityModeParams} from './UpdateChatPriorityModeParams'; export type {default as UpdateDateOfBirthParams} from './UpdateDateOfBirthParams'; export type {default as UpdateDisplayNameParams} from './UpdateDisplayNameParams'; -export type {default as UpdateFrequentlyUsedEmojisParams} from './UpdateFrequentlyUsedEmojisParams'; export type {default as UpdateGroupChatNameParams} from './UpdateGroupChatNameParams'; export type {default as UpdateGroupChatMemberRolesParams} from './UpdateGroupChatMemberRolesParams'; export type {default as UpdateHomeAddressParams} from './UpdateHomeAddressParams'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index 92a876b7b52f..948ed7f76373 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -57,7 +57,6 @@ const WRITE_COMMANDS = { VALIDATE_LOGIN: 'ValidateLogin', VALIDATE_SECONDARY_LOGIN: 'ValidateSecondaryLogin', UPDATE_PREFERRED_EMOJI_SKIN_TONE: 'UpdatePreferredEmojiSkinTone', - UPDATE_FREQUENTLY_USED_EMOJIS: 'UpdateFrequentlyUsedEmojis', UPDATE_CHAT_PRIORITY_MODE: 'UpdateChatPriorityMode', SET_CONTACT_METHOD_AS_DEFAULT: 'SetContactMethodAsDefault', UPDATE_THEME: 'UpdateTheme', @@ -351,7 +350,6 @@ type WriteCommandParameters = { [WRITE_COMMANDS.VALIDATE_LOGIN]: Parameters.ValidateLoginParams; [WRITE_COMMANDS.VALIDATE_SECONDARY_LOGIN]: Parameters.ValidateSecondaryLoginParams; [WRITE_COMMANDS.UPDATE_PREFERRED_EMOJI_SKIN_TONE]: Parameters.UpdatePreferredEmojiSkinToneParams; - [WRITE_COMMANDS.UPDATE_FREQUENTLY_USED_EMOJIS]: Parameters.UpdateFrequentlyUsedEmojisParams; [WRITE_COMMANDS.UPDATE_CHAT_PRIORITY_MODE]: Parameters.UpdateChatPriorityModeParams; [WRITE_COMMANDS.SET_CONTACT_METHOD_AS_DEFAULT]: Parameters.SetContactMethodAsDefaultParams; [WRITE_COMMANDS.UPDATE_THEME]: Parameters.UpdateThemeParams; diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index 6fb5725addfc..007a892c048e 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -1,4 +1,3 @@ -import {getUnixTime} from 'date-fns'; import {Str} from 'expensify-common'; import memoize from 'lodash/memoize'; import Onyx from 'react-native-onyx'; @@ -235,37 +234,6 @@ function mergeEmojisWithFrequentlyUsedEmojis(emojis: PickerEmojis): EmojiPickerL return addSpacesToEmojiCategories(mergedEmojis); } -/** - * Get the updated frequently used emojis list by usage - */ -function getFrequentlyUsedEmojis(newEmoji: Emoji | Emoji[]): FrequentlyUsedEmoji[] { - let frequentEmojiList = [...frequentlyUsedEmojis]; - - const maxFrequentEmojiCount = CONST.EMOJI_FREQUENT_ROW_COUNT * CONST.EMOJI_NUM_PER_ROW - 1; - - const currentTimestamp = getUnixTime(new Date()); - (Array.isArray(newEmoji) ? [...newEmoji] : [newEmoji]).forEach((emoji) => { - let currentEmojiCount = 1; - const emojiIndex = frequentEmojiList.findIndex((e) => e.code === emoji.code); - if (emojiIndex >= 0) { - currentEmojiCount = frequentEmojiList[emojiIndex].count + 1; - frequentEmojiList.splice(emojiIndex, 1); - } - - const updatedEmoji = {...Emojis.emojiCodeTableWithSkinTones[emoji.code], count: currentEmojiCount, lastUpdatedAt: currentTimestamp}; - - // We want to make sure the current emoji is added to the list - // Hence, we take one less than the current frequent used emojis - frequentEmojiList = frequentEmojiList.slice(0, maxFrequentEmojiCount); - frequentEmojiList.push(updatedEmoji); - - // Sort the list by count and lastUpdatedAt in descending order - frequentEmojiList.sort((a, b) => b.count - a.count || b.lastUpdatedAt - a.lastUpdatedAt); - }); - - return frequentEmojiList; -} - /** * Given an emoji item object, return an emoji code based on its type. */ @@ -601,7 +569,6 @@ export { getLocalizedEmojiName, getHeaderEmojis, mergeEmojisWithFrequentlyUsedEmojis, - getFrequentlyUsedEmojis, containsOnlyEmojis, replaceEmojis, suggestEmojis, diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index 7acc79485f0c..7b3b1abd04ef 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -13,7 +13,6 @@ import type { SetContactMethodAsDefaultParams, SetNameValuePairParams, UpdateChatPriorityModeParams, - UpdateFrequentlyUsedEmojisParams, UpdateNewsletterSubscriptionParams, UpdatePreferredEmojiSkinToneParams, UpdateStatusParams, @@ -37,7 +36,7 @@ import Visibility from '@libs/Visibility'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {BlockedFromConcierge, CustomStatusDraft, FrequentlyUsedEmoji, Policy} from '@src/types/onyx'; +import type {BlockedFromConcierge, CustomStatusDraft, Policy} from '@src/types/onyx'; import type Login from '@src/types/onyx/Login'; import type {OnyxServerUpdate} from '@src/types/onyx/OnyxUpdatesFromServer'; import type OnyxPersonalDetails from '@src/types/onyx/PersonalDetails'; @@ -655,23 +654,6 @@ function updatePreferredSkinTone(skinTone: number) { API.write(WRITE_COMMANDS.UPDATE_PREFERRED_EMOJI_SKIN_TONE, parameters, {optimisticData}); } -/** - * Sync frequentlyUsedEmojis with Onyx and Server - */ -function updateFrequentlyUsedEmojis(frequentlyUsedEmojis: FrequentlyUsedEmoji[]) { - const optimisticData: OnyxUpdate[] = [ - { - onyxMethod: Onyx.METHOD.SET, - key: ONYXKEYS.FREQUENTLY_USED_EMOJIS, - value: frequentlyUsedEmojis, - }, - ]; - - const parameters: UpdateFrequentlyUsedEmojisParams = {value: JSON.stringify(frequentlyUsedEmojis)}; - - API.write(WRITE_COMMANDS.UPDATE_FREQUENTLY_USED_EMOJIS, parameters, {optimisticData}); -} - /** * Sync user chat priority mode with Onyx and Server * @param mode @@ -1045,7 +1027,6 @@ export { setShouldUseStagingServer, setMuteAllSounds, clearUserErrorMessage, - updateFrequentlyUsedEmojis, joinScreenShare, clearScreenShareRequest, generateStatementPDF, diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index 6cc55c825983..1df45303694a 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -53,7 +53,6 @@ import * as EmojiPickerActions from '@userActions/EmojiPickerAction'; import * as InputFocus from '@userActions/InputFocus'; import * as Modal from '@userActions/Modal'; import * as Report from '@userActions/Report'; -import * as User from '@userActions/User'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type * as OnyxTypes from '@src/types/onyx'; @@ -304,22 +303,12 @@ function ComposerWithSuggestions( const [composerHeight, setComposerHeight] = useState(0); const textInputRef = useRef(null); - const insertedEmojisRef = useRef([]); const syncSelectionWithOnChangeTextRef = useRef(null); // The ref to check whether the comment saving is in progress const isCommentPendingSaved = useRef(false); - /** - * Update frequently used emojis list. We debounce this method in the constructor so that UpdateFrequentlyUsedEmojis - * API is not called too often. - */ - const debouncedUpdateFrequentlyUsedEmojis = useCallback(() => { - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(insertedEmojisRef.current)); - insertedEmojisRef.current = []; - }, []); - /** * Set the TextInput Ref */ @@ -421,8 +410,6 @@ function ComposerWithSuggestions( if (suggestionsRef.current) { suggestionsRef.current.resetSuggestions(); } - insertedEmojisRef.current = [...insertedEmojisRef.current, ...newEmojis]; - debouncedUpdateFrequentlyUsedEmojis(); } } const newCommentConverted = convertToLTRForComposer(newComment); @@ -461,18 +448,7 @@ function ComposerWithSuggestions( debouncedBroadcastUserIsTyping(reportID); } }, - [ - debouncedUpdateFrequentlyUsedEmojis, - findNewlyAddedChars, - preferredLocale, - preferredSkinTone, - reportID, - setIsCommentEmpty, - suggestionsRef, - raiseIsScrollLikelyLayoutTriggered, - debouncedSaveReportComment, - selection.end, - ], + [findNewlyAddedChars, preferredLocale, preferredSkinTone, reportID, setIsCommentEmpty, suggestionsRef, raiseIsScrollLikelyLayoutTriggered, debouncedSaveReportComment, selection.end], ); const prepareCommentAndResetComposer = useCallback((): string => { diff --git a/src/pages/home/report/ReportActionItemMessageEdit.tsx b/src/pages/home/report/ReportActionItemMessageEdit.tsx index 6618b20a5a6a..cb68410131ce 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.tsx +++ b/src/pages/home/report/ReportActionItemMessageEdit.tsx @@ -37,7 +37,6 @@ import * as ComposerActions from '@userActions/Composer'; import * as EmojiPickerAction from '@userActions/EmojiPickerAction'; import * as InputFocus from '@userActions/InputFocus'; import * as Report from '@userActions/Report'; -import * as User from '@userActions/User'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type * as OnyxTypes from '@src/types/onyx'; @@ -105,7 +104,6 @@ function ReportActionItemMessageEdit( const textInputRef = useRef<(HTMLTextAreaElement & TextInput) | null>(null); const isFocusedRef = useRef(false); - const insertedEmojis = useRef([]); const draftRef = useRef(draft); const emojiPickerSelectionRef = useRef(undefined); // The ref to check whether the comment saving is in progress @@ -214,19 +212,6 @@ function ReportActionItemMessageEdit( [debouncedSaveDraft], ); - /** - * Update frequently used emojis list. We debounce this method in the constructor so that UpdateFrequentlyUsedEmojis - * API is not called too often. - */ - const debouncedUpdateFrequentlyUsedEmojis = useMemo( - () => - lodashDebounce(() => { - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(insertedEmojis.current)); - insertedEmojis.current = []; - }, 1000), - [], - ); - /** * Update the value of the draft in Onyx * @@ -236,13 +221,6 @@ function ReportActionItemMessageEdit( (newDraftInput: string) => { const {text: newDraft, emojis, cursorPosition} = EmojiUtils.replaceAndExtractEmojis(newDraftInput, preferredSkinTone, preferredLocale); - if (emojis?.length > 0) { - const newEmojis = EmojiUtils.getAddedEmojis(emojis, emojisPresentBefore.current); - if (newEmojis?.length > 0) { - insertedEmojis.current = [...insertedEmojis.current, ...newEmojis]; - debouncedUpdateFrequentlyUsedEmojis(); - } - } emojisPresentBefore.current = emojis; setDraft(newDraft); @@ -261,7 +239,7 @@ function ReportActionItemMessageEdit( debouncedSaveDraft(newDraft); isCommentPendingSaved.current = true; }, - [debouncedSaveDraft, debouncedUpdateFrequentlyUsedEmojis, preferredSkinTone, preferredLocale, selection.end], + [debouncedSaveDraft, preferredSkinTone, preferredLocale, selection.end], ); useEffect(() => { diff --git a/tests/unit/EmojiTest.ts b/tests/unit/EmojiTest.ts index 968e543363f2..84442db92553 100644 --- a/tests/unit/EmojiTest.ts +++ b/tests/unit/EmojiTest.ts @@ -1,15 +1,7 @@ -import {getUnixTime} from 'date-fns'; -import Onyx from 'react-native-onyx'; import Emojis, {importEmojiLocale} from '@assets/emojis'; import type {Emoji} from '@assets/emojis/types'; -import * as User from '@libs/actions/User'; import {buildEmojisTrie} from '@libs/EmojiTrie'; import * as EmojiUtils from '@libs/EmojiUtils'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import type {FrequentlyUsedEmoji} from '@src/types/onyx'; -import * as TestHelper from '../utils/TestHelper'; -import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; describe('EmojiTest', () => { beforeAll(async () => { @@ -196,327 +188,4 @@ describe('EmojiTest', () => { }, ]); }); - - describe('update frequently used emojis', () => { - let spy: jest.SpyInstance; - - beforeAll(() => { - Onyx.init({keys: ONYXKEYS}); - global.fetch = TestHelper.getGlobalFetchMock(); - spy = jest.spyOn(User, 'updateFrequentlyUsedEmojis'); - }); - - beforeEach(() => { - spy.mockClear(); - return Onyx.clear(); - }); - - it('should put a less frequent and recent used emoji behind', () => { - // Given an existing frequently used emojis list with count > 1 - const frequentlyEmojisList: FrequentlyUsedEmoji[] = [ - { - code: '👋', - name: 'wave', - count: 2, - lastUpdatedAt: 4, - types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'], - }, - { - code: '💤', - name: 'zzz', - count: 2, - lastUpdatedAt: 3, - }, - { - code: '💯', - name: '100', - count: 2, - lastUpdatedAt: 2, - }, - { - code: '👿', - name: 'imp', - count: 2, - lastUpdatedAt: 1, - }, - ]; - Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList); - - return waitForBatchedUpdates().then(() => { - // When add a new emoji - const currentTime = getUnixTime(new Date()); - const smileEmoji: Emoji = {code: '😄', name: 'smile'}; - const newEmoji = [smileEmoji]; - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); - - // Then the new emoji should be at the last item of the list - const expectedSmileEmoji: FrequentlyUsedEmoji = {...smileEmoji, count: 1, lastUpdatedAt: currentTime}; - - const expectedFrequentlyEmojisList = [...frequentlyEmojisList, expectedSmileEmoji]; - expect(spy).toBeCalledWith(expectedFrequentlyEmojisList); - }); - }); - - it('should put more frequent and recent used emoji to the front', () => { - // Given an existing frequently used emojis list - const smileEmoji: Emoji = {code: '😄', name: 'smile'}; - const frequentlyEmojisList: FrequentlyUsedEmoji[] = [ - { - code: '😠', - name: 'angry', - count: 3, - lastUpdatedAt: 5, - }, - { - code: '👋', - name: 'wave', - count: 2, - lastUpdatedAt: 4, - types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'], - }, - { - code: '💤', - name: 'zzz', - count: 2, - lastUpdatedAt: 3, - }, - { - code: '💯', - name: '100', - count: 1, - lastUpdatedAt: 2, - }, - {...smileEmoji, count: 1, lastUpdatedAt: 1}, - ]; - Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList); - - return waitForBatchedUpdates().then(() => { - // When add an emoji that exists in the list - const currentTime = getUnixTime(new Date()); - const newEmoji = [smileEmoji]; - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); - - // Then the count should be increased and put into the very front of the other emoji within the same count - const expectedFrequentlyEmojisList = [frequentlyEmojisList[0], {...smileEmoji, count: 2, lastUpdatedAt: currentTime}, ...frequentlyEmojisList.slice(1, -1)]; - expect(spy).toBeCalledWith(expectedFrequentlyEmojisList); - }); - }); - - it('should sorted descending by count and lastUpdatedAt for multiple emoji added', () => { - // Given an existing frequently used emojis list - const smileEmoji: Emoji = {code: '😄', name: 'smile'}; - const zzzEmoji: Emoji = {code: '💤', name: 'zzz'}; - const impEmoji: Emoji = {code: '👿', name: 'imp'}; - const frequentlyEmojisList: FrequentlyUsedEmoji[] = [ - { - code: '😠', - name: 'angry', - count: 3, - lastUpdatedAt: 5, - }, - { - code: '👋', - name: 'wave', - count: 2, - lastUpdatedAt: 4, - types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'], - }, - {...zzzEmoji, count: 2, lastUpdatedAt: 3}, - { - code: '💯', - name: '100', - count: 1, - lastUpdatedAt: 2, - }, - {...smileEmoji, count: 1, lastUpdatedAt: 1}, - ]; - Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList); - - return waitForBatchedUpdates().then(() => { - // When add multiple emojis that either exist or not exist in the list - const currentTime = getUnixTime(new Date()); - const newEmoji = [smileEmoji, zzzEmoji, impEmoji]; - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); - - // Then the count should be increased for existing emoji and sorted descending by count and lastUpdatedAt - const expectedFrequentlyEmojisList = [ - {...zzzEmoji, count: 3, lastUpdatedAt: currentTime}, - frequentlyEmojisList[0], - {...smileEmoji, count: 2, lastUpdatedAt: currentTime}, - frequentlyEmojisList[1], - {...impEmoji, count: 1, lastUpdatedAt: currentTime}, - frequentlyEmojisList[3], - ]; - expect(spy).toBeCalledWith(expectedFrequentlyEmojisList); - }); - }); - - it('make sure the most recent new emoji is added to the list even it is full with count > 1', () => { - // Given an existing full (24 items) frequently used emojis list - const smileEmoji: Emoji = {code: '😄', name: 'smile'}; - const zzzEmoji: Emoji = {code: '💤', name: 'zzz'}; - const impEmoji: Emoji = {code: '👿', name: 'imp'}; - const bookEmoji: Emoji = {code: '📚', name: 'books'}; - const frequentlyEmojisList: FrequentlyUsedEmoji[] = [ - { - code: '😠', - name: 'angry', - count: 3, - lastUpdatedAt: 24, - }, - { - code: '👋', - name: 'wave', - count: 3, - lastUpdatedAt: 23, - types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'], - }, - { - code: '😡', - name: 'rage', - count: 3, - lastUpdatedAt: 22, - }, - { - code: '😤', - name: 'triumph', - count: 3, - lastUpdatedAt: 21, - }, - { - code: '🥱', - name: 'yawning_face', - count: 3, - lastUpdatedAt: 20, - }, - { - code: '😫', - name: 'tired_face', - count: 3, - lastUpdatedAt: 19, - }, - { - code: '😩', - name: 'weary', - count: 3, - lastUpdatedAt: 18, - }, - { - code: '😓', - name: 'sweat', - count: 3, - lastUpdatedAt: 17, - }, - { - code: '😞', - name: 'disappointed', - count: 3, - lastUpdatedAt: 16, - }, - { - code: '😣', - name: 'persevere', - count: 3, - lastUpdatedAt: 15, - }, - { - code: '😖', - name: 'confounded', - count: 3, - lastUpdatedAt: 14, - }, - { - code: '👶', - name: 'baby', - count: 3, - lastUpdatedAt: 13, - types: ['👶🏿', '👶🏾', '👶🏽', '👶🏼', '👶🏻'], - }, - { - code: '👄', - name: 'lips', - count: 3, - lastUpdatedAt: 12, - }, - { - code: '🐶', - name: 'dog', - count: 3, - lastUpdatedAt: 11, - }, - { - code: '🦮', - name: 'guide_dog', - count: 3, - lastUpdatedAt: 10, - }, - { - code: '🐱', - name: 'cat', - count: 3, - lastUpdatedAt: 9, - }, - { - code: '🐈‍⬛', - name: 'black_cat', - count: 3, - lastUpdatedAt: 8, - }, - { - code: '🕞', - name: 'clock330', - count: 3, - lastUpdatedAt: 7, - }, - { - code: '🥎', - name: 'softball', - count: 3, - lastUpdatedAt: 6, - }, - { - code: '🏀', - name: 'basketball', - count: 3, - lastUpdatedAt: 5, - }, - { - code: '📟', - name: 'pager', - count: 3, - lastUpdatedAt: 4, - }, - { - code: '🎬', - name: 'clapper', - count: 3, - lastUpdatedAt: 3, - }, - { - code: '📺', - name: 'tv', - count: 3, - lastUpdatedAt: 2, - }, - {...bookEmoji, count: 3, lastUpdatedAt: 1}, - ]; - expect(frequentlyEmojisList.length).toBe(CONST.EMOJI_FREQUENT_ROW_COUNT * CONST.EMOJI_NUM_PER_ROW); - Onyx.merge(ONYXKEYS.FREQUENTLY_USED_EMOJIS, frequentlyEmojisList); - - return waitForBatchedUpdates().then(() => { - // When add new emojis - const currentTime = getUnixTime(new Date()); - const newEmoji = [bookEmoji, smileEmoji, zzzEmoji, impEmoji, smileEmoji]; - User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); - - // Then the last emojis from the list should be replaced with the most recent new emoji (smile) - const expectedFrequentlyEmojisList = [ - {...bookEmoji, count: 4, lastUpdatedAt: currentTime}, - ...frequentlyEmojisList.slice(0, -2), - {...smileEmoji, count: 1, lastUpdatedAt: currentTime}, - ]; - expect(spy).toBeCalledWith(expectedFrequentlyEmojisList); - }); - }); - }); });