@@ -59,6 +59,7 @@ import { base64LogsTabLabel, logsLabel, textLogsTabLabel } from '../components/a
5959import { InnerTransactionPage } from './inner-transaction-page'
6060import { base64ToUtf8 } from '@/utils/base64-to-utf8'
6161import { textListAssertion } from '@/tests/assertions/text-list-assertion'
62+ import { AssetResult } from '@algorandfoundation/algokit-utils/types/indexer'
6263
6364describe ( 'transaction-page' , ( ) => {
6465 describe ( 'when rendering a transaction with an invalid id' , ( ) => {
@@ -688,7 +689,10 @@ describe('transaction-page', () => {
688689 vi . mocked ( useParams ) . mockImplementation ( ( ) => ( { transactionId : transaction . id , innerTransactionId : '2' } ) )
689690 const myStore = createStore ( )
690691 myStore . set ( transactionsAtom , new Map ( [ [ transaction . id , transaction ] ] ) )
691- myStore . set ( assetsAtom , new Map ( assets . map ( ( a ) => [ a . index , a ] ) ) )
692+ myStore . set (
693+ assetsAtom ,
694+ new Map ( [ [ algoAssetResult . index , algoAssetResult ] , ...assets . map < [ number , AssetResult ] > ( ( a ) => [ a . index , a ] ) ] )
695+ )
692696
693697 return executeComponentTest (
694698 ( ) => {
@@ -797,4 +801,37 @@ describe('transaction-page', () => {
797801 )
798802 } )
799803 } )
804+
805+ describe ( 'when rendering an app call transaction that has no foreign assets but has an inner asset transfer transaction' , ( ) => {
806+ const asset = assetResultMother [ 'mainnet-312769' ] ( ) . build ( )
807+ const innerAssetTransferTransaction = transactionResultMother . transfer ( asset ) . build ( )
808+ const transaction = transactionResultMother . appCall ( ) [ 'withInner-txns' ] ( [ innerAssetTransferTransaction ] ) . build ( )
809+
810+ it ( 'should be rendered without error' , ( ) => {
811+ vi . mocked ( useParams ) . mockImplementation ( ( ) => ( { transactionId : transaction . id } ) )
812+ const myStore = createStore ( )
813+ myStore . set ( transactionsAtom , new Map ( [ [ transaction . id , transaction ] ] ) )
814+ myStore . set (
815+ assetsAtom ,
816+ new Map ( [
817+ [ algoAssetResult . index , algoAssetResult ] ,
818+ [ asset . index , asset ] ,
819+ ] )
820+ )
821+
822+ return executeComponentTest (
823+ ( ) => {
824+ return render ( < TransactionPage /> , undefined , myStore )
825+ } ,
826+ async ( component ) => {
827+ await waitFor ( ( ) => {
828+ descriptionListAssertion ( {
829+ container : component . container ,
830+ items : [ { term : transactionIdLabel , description : transaction . id } ] ,
831+ } )
832+ } )
833+ }
834+ )
835+ } )
836+ } )
800837} )
0 commit comments