1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix useTransactionDisplayData unit tests (#10134) (#10137)

New year, new problems.

It's working as expected, but we had hard-coded some 2020 date values, and `formatDateWithYearContext` adds the year to its output formatted date if the date is not from the current year.

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
This commit is contained in:
Mark Stacey 2021-01-04 15:20:40 -03:30 committed by GitHub
parent e7a839d224
commit 13a85db844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.SEND, category: TRANSACTION_GROUP_CATEGORIES.SEND,
subtitle: 'To: 0xffe5...1a97', subtitle: 'To: 0xffe5...1a97',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 12', date: 'May 12, 2020',
primaryCurrency: '-1 ETH', primaryCurrency: '-1 ETH',
senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
recipientAddress: '0xffe5bc4e8f1f969934d773fa67da095d2e491a97', recipientAddress: '0xffe5bc4e8f1f969934d773fa67da095d2e491a97',
@ -44,7 +44,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.SEND, category: TRANSACTION_GROUP_CATEGORIES.SEND,
subtitle: 'To: 0x0ccc...8848', subtitle: 'To: 0x0ccc...8848',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 12', date: 'May 12, 2020',
primaryCurrency: '-2 ETH', primaryCurrency: '-2 ETH',
senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
recipientAddress: '0x0ccc8aeeaf5ce790f3b448325981a143fdef8848', recipientAddress: '0x0ccc8aeeaf5ce790f3b448325981a143fdef8848',
@ -57,7 +57,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.SEND, category: TRANSACTION_GROUP_CATEGORIES.SEND,
subtitle: 'To: 0xffe5...1a97', subtitle: 'To: 0xffe5...1a97',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 12', date: 'May 12, 2020',
primaryCurrency: '-2 ETH', primaryCurrency: '-2 ETH',
senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
recipientAddress: '0xffe5bc4e8f1f969934d773fa67da095d2e491a97', recipientAddress: '0xffe5bc4e8f1f969934d773fa67da095d2e491a97',
@ -70,7 +70,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.RECEIVE, category: TRANSACTION_GROUP_CATEGORIES.RECEIVE,
subtitle: 'From: 0x31b9...4523', subtitle: 'From: 0x31b9...4523',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 12', date: 'May 12, 2020',
primaryCurrency: '18.75 ETH', primaryCurrency: '18.75 ETH',
senderAddress: '0x31b98d14007bdee637298086988a0bbd31184523', senderAddress: '0x31b98d14007bdee637298086988a0bbd31184523',
recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
@ -83,7 +83,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.RECEIVE, category: TRANSACTION_GROUP_CATEGORIES.RECEIVE,
subtitle: 'From: 0x9eca...a149', subtitle: 'From: 0x9eca...a149',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 8', date: 'May 8, 2020',
primaryCurrency: '0 ETH', primaryCurrency: '0 ETH',
senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', senderAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
@ -96,7 +96,7 @@ const expectedResults = [
category: TRANSACTION_GROUP_CATEGORIES.RECEIVE, category: TRANSACTION_GROUP_CATEGORIES.RECEIVE,
subtitle: 'From: 0xee01...febb', subtitle: 'From: 0xee01...febb',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 24', date: 'May 24, 2020',
primaryCurrency: '1 ETH', primaryCurrency: '1 ETH',
senderAddress: '0xee014609ef9e09776ac5fe00bdbfef57bcdefebb', senderAddress: '0xee014609ef9e09776ac5fe00bdbfef57bcdefebb',
recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149', recipientAddress: '0x9eca64466f257793eaa52fcfff5066894b76a149',
@ -109,7 +109,7 @@ const expectedResults = [
category: TRANSACTION_CATEGORIES.SWAP, category: TRANSACTION_CATEGORIES.SWAP,
subtitle: '', subtitle: '',
subtitleContainsOrigin: false, subtitleContainsOrigin: false,
date: 'May 12', date: 'May 12, 2020',
primaryCurrency: '+1 ABC', primaryCurrency: '+1 ABC',
senderAddress: '0xee014609ef9e09776ac5fe00bdbfef57bcdefebb', senderAddress: '0xee014609ef9e09776ac5fe00bdbfef57bcdefebb',
recipientAddress: '0xabca64466f257793eaa52fcfff5066894b76a149', recipientAddress: '0xabca64466f257793eaa52fcfff5066894b76a149',