@@ -9,7 +9,7 @@ import { blockResultMother } from '@/tests/object-mother/block-result'
99import { createStore } from 'jotai'
1010import { blocksAtom } from '../data/core'
1111import { nextRoundLabel , previousRoundLabel , roundLabel , timestampLabel , transactionsLabel } from '../components/block-details'
12- import { transactionsAtom } from '@/features/transactions/data'
12+ import { transactionResultsAtom } from '@/features/transactions/data'
1313import { transactionResultMother } from '@/tests/object-mother/transaction-result'
1414import { assetResultMother } from '@/tests/object-mother/asset-result'
1515import { assetsAtom } from '@/features/assets/data/core'
@@ -93,16 +93,16 @@ describe('block-page', () => {
9393
9494 describe ( 'and has transactions' , ( ) => {
9595 const asset = assetResultMother [ 'mainnet-312769' ] ( ) . build ( )
96- const transaction1 = transactionResultMother . payment ( ) . withGroup ( 'W3pIVuWVJlzmMDGvX8St0W/DPxslnpt6vKV8zoFb6rg=' ) . build ( )
97- const transaction2 = transactionResultMother . transfer ( asset ) . build ( )
98- const transactions = [ transaction1 , transaction2 ]
99- const block = blockResultMother . blockWithTransactions ( transactions ) . withTimestamp ( '2024-02-29T06:52:01Z' ) . build ( )
96+ const transactionResult1 = transactionResultMother . payment ( ) . withGroup ( 'W3pIVuWVJlzmMDGvX8St0W/DPxslnpt6vKV8zoFb6rg=' ) . build ( )
97+ const transactionResult2 = transactionResultMother . transfer ( asset ) . build ( )
98+ const transactionResults = [ transactionResult1 , transactionResult2 ]
99+ const block = blockResultMother . blockWithTransactions ( transactionResults ) . withTimestamp ( '2024-02-29T06:52:01Z' ) . build ( )
100100
101101 it ( 'should be rendered with the correct data' , ( ) => {
102102 vi . mocked ( useParams ) . mockImplementation ( ( ) => ( { round : block . round . toString ( ) } ) )
103103 const myStore = createStore ( )
104104 myStore . set ( blocksAtom , new Map ( [ [ block . round , block ] ] ) )
105- myStore . set ( transactionsAtom , new Map ( transactions . map ( ( x ) => [ x . id , x ] ) ) )
105+ myStore . set ( transactionResultsAtom , new Map ( transactionResults . map ( ( x ) => [ x . id , x ] ) ) )
106106 myStore . set ( assetsAtom , new Map ( [ [ asset . index , asset ] ] ) )
107107
108108 return executeComponentTest (
@@ -129,22 +129,22 @@ describe('block-page', () => {
129129 rows : [
130130 {
131131 cells : [
132- ellipseId ( transaction1 . id ) ,
133- ellipseId ( transaction1 . group ) ,
134- ellipseAddress ( transaction1 . sender ) ,
135- ellipseAddress ( transaction1 [ 'payment-transaction' ] ! . receiver ) ,
132+ ellipseId ( transactionResult1 . id ) ,
133+ ellipseId ( transactionResult1 . group ) ,
134+ ellipseAddress ( transactionResult1 . sender ) ,
135+ ellipseAddress ( transactionResult1 [ 'payment-transaction' ] ! . receiver ) ,
136136 'Payment' ,
137- ( transaction1 [ 'payment-transaction' ] ! . amount / 1e6 ) . toString ( ) ,
137+ ( transactionResult1 [ 'payment-transaction' ] ! . amount / 1e6 ) . toString ( ) ,
138138 ] ,
139139 } ,
140140 {
141141 cells : [
142- ellipseId ( transaction2 . id ) ,
143- ellipseId ( transaction2 . group ) ,
144- ellipseAddress ( transaction2 . sender ) ,
145- ellipseAddress ( transaction2 [ 'asset-transfer-transaction' ] ! . receiver ) ,
142+ ellipseId ( transactionResult2 . id ) ,
143+ ellipseId ( transactionResult2 . group ) ,
144+ ellipseAddress ( transactionResult2 . sender ) ,
145+ ellipseAddress ( transactionResult2 [ 'asset-transfer-transaction' ] ! . receiver ) ,
146146 'Asset Transfer' ,
147- `${ ( transaction2 [ 'asset-transfer-transaction' ] ! . amount as number ) / 1e6 } USDt` ,
147+ `${ ( transactionResult2 [ 'asset-transfer-transaction' ] ! . amount as number ) / 1e6 } USDt` ,
148148 ] ,
149149 } ,
150150 ] ,
0 commit comments