From 7c18da2556bef8941c44f8a05db4ed2817f9e3d0 Mon Sep 17 00:00:00 2001 From: Artem Makushov Date: Tue, 26 Sep 2023 00:46:39 +0200 Subject: [PATCH] additional changes --- tests/unit/EmojiTest.js | 10 +++++----- tests/unit/createOrUpdateStagingDeployTest.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/EmojiTest.js b/tests/unit/EmojiTest.js index 2cc38648f0d9..d10da618480e 100644 --- a/tests/unit/EmojiTest.js +++ b/tests/unit/EmojiTest.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import moment from 'moment'; +import {getUnixTime} from 'date-fns'; import Onyx from 'react-native-onyx'; import lodashGet from 'lodash/get'; import Emoji from '../../assets/emojis'; @@ -206,7 +206,7 @@ describe('EmojiTest', () => { return waitForBatchedUpdates().then(() => { // When add a new emoji - const currentTime = moment().unix(); + const currentTime = getUnixTime(new Date()); const smileEmoji = {code: '😄', name: 'smile'}; const newEmoji = [smileEmoji]; User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); @@ -254,7 +254,7 @@ describe('EmojiTest', () => { return waitForBatchedUpdates().then(() => { // When add an emoji that exists in the list - const currentTime = moment().unix(); + const currentTime = getUnixTime(new Date()); const newEmoji = [smileEmoji]; User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); @@ -296,7 +296,7 @@ describe('EmojiTest', () => { return waitForBatchedUpdates().then(() => { // When add multiple emojis that either exist or not exist in the list - const currentTime = moment().unix(); + const currentTime = getUnixTime(new Date()); const newEmoji = [smileEmoji, zzzEmoji, impEmoji]; User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); @@ -467,7 +467,7 @@ describe('EmojiTest', () => { return waitForBatchedUpdates().then(() => { // When add new emojis - const currentTime = moment().unix(); + const currentTime = getUnixTime(new Date()); const newEmoji = [bookEmoji, smileEmoji, zzzEmoji, impEmoji, smileEmoji]; User.updateFrequentlyUsedEmojis(EmojiUtils.getFrequentlyUsedEmojis(newEmoji)); diff --git a/tests/unit/createOrUpdateStagingDeployTest.js b/tests/unit/createOrUpdateStagingDeployTest.js index dd87e74f6faa..9183268f15f0 100644 --- a/tests/unit/createOrUpdateStagingDeployTest.js +++ b/tests/unit/createOrUpdateStagingDeployTest.js @@ -2,7 +2,7 @@ * @jest-environment node */ const core = require('@actions/core'); -const moment = require('moment'); +const fns = require('date-fns'); const CONST = require('../../.github/libs/CONST'); const GitUtils = require('../../.github/libs/GitUtils'); const GithubUtils = require('../../.github/libs/GithubUtils'); @@ -168,7 +168,7 @@ describe('createOrUpdateStagingDeployCash', () => { expect(result).toStrictEqual({ owner: CONST.GITHUB_OWNER, repo: CONST.APP_REPO, - title: `Deploy Checklist: New Expensify ${moment().format('YYYY-MM-DD')}`, + title: `Deploy Checklist: New Expensify ${fns.format(new Date(), 'yyyy-MM-dd')}`, labels: [CONST.LABELS.STAGING_DEPLOY], html_url: 'https://github.com/Expensify/App/issues/29', assignees: [CONST.APPLAUSE_BOT],