@@ -44,8 +44,6 @@ describe('Render transactions page with search params', () => {
4444 vitest . clearAllMocks ( )
4545 } )
4646 describe ( 'key registration search params' , ( ) => {
47- beforeEach ( ( ) => { } )
48-
4947 it ( 'should render offline key registration' , async ( ) => {
5048 const sender = 'I3345FUQQ2GRBHFZQPLYQQX5HJMMRZMABCHRLWV6RCJYC6OO4MOLEUBEGU'
5149 renderTxnsWizardPageWithSearchParams ( {
@@ -125,6 +123,21 @@ describe('Render transactions page with search params', () => {
125123 expect ( await screen . findByText ( votelst . toString ( ) ) ) . toBeInTheDocument ( )
126124 expect ( await screen . findByText ( '2' ) ) . toBeInTheDocument ( )
127125 } )
126+
127+ it ( 'should render key registration without sender - auto populate sender with localnet address' , async ( ) => {
128+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
129+
130+ renderTxnsWizardPageWithSearchParams ( {
131+ searchParams : new URLSearchParams ( {
132+ 'type[0]' : 'keyreg' ,
133+ } ) ,
134+ } )
135+
136+ expect ( await screen . findByText ( 'Offline' ) ) . toBeInTheDocument ( )
137+ // Find the yellow sender link (auto-populated)
138+ const senderLinks = await screen . findAllByText ( localnetDispenderAccount . addr . toString ( ) )
139+ expect ( senderLinks . some ( ( link ) => link . className . includes ( 'text-yellow-500' ) ) ) . toBe ( true )
140+ } )
128141 } )
129142
130143 describe ( 'payment transaction search params' , ( ) => {
@@ -201,7 +214,7 @@ describe('Render transactions page with search params', () => {
201214
202215 // Test is failing with "Can't get LocalNet dispenser account from non LocalNet network""
203216 it ( 'should render payment transaction without sender - auto populate sender with localnet address' , async ( ) => {
204- const localnetDispenderAccount = ( await localnet . algorand . account . localNetDispenser ( ) ) . addr . toString ( )
217+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
205218
206219 renderTxnsWizardPageWithSearchParams ( {
207220 searchParams : new URLSearchParams ( {
@@ -216,7 +229,7 @@ describe('Render transactions page with search params', () => {
216229 expect ( await screen . findByText ( receiver ) ) . toBeInTheDocument ( )
217230 expect ( await screen . findByText ( '2.5' ) ) . toBeInTheDocument ( )
218231 expect ( await screen . findByText ( note ) ) . toBeInTheDocument ( )
219- expect ( await screen . findByText ( localnetDispenderAccount ) ) . toBeInTheDocument ( )
232+ expect ( await screen . findByText ( localnetDispenderAccount . toString ( ) ) ) . toBeInTheDocument ( )
220233 } )
221234
222235 it . each ( [
@@ -382,6 +395,24 @@ describe('Render transactions page with search params', () => {
382395 expect ( await screen . findByText ( note ) ) . toBeInTheDocument ( )
383396 } )
384397
398+ it ( 'should render asset create transaction without sender - auto populate sender with localnet address' , async ( ) => {
399+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
400+
401+ renderTxnsWizardPageWithSearchParams ( {
402+ searchParams : new URLSearchParams ( {
403+ 'type[0]' : 'acfg' ,
404+ 'total[0]' : total ,
405+ 'decimals[0]' : decimals ,
406+ 'note[0]' : note ,
407+ } ) ,
408+ } )
409+
410+ expect ( await screen . findByText ( total ) ) . toBeInTheDocument ( )
411+ expect ( await screen . findByText ( decimals ) ) . toBeInTheDocument ( )
412+ expect ( await screen . findByText ( note ) ) . toBeInTheDocument ( )
413+ expect ( await screen . findByText ( localnetDispenderAccount . addr . toString ( ) ) ) . toBeInTheDocument ( )
414+ } )
415+
385416 it . each ( [
386417 // Missing required field cases
387418
@@ -575,6 +606,25 @@ describe('Render transactions page with search params', () => {
575606 expect ( await screen . findByText ( `0 ${ unitName } ` ) ) . toBeInTheDocument ( )
576607 } )
577608
609+ it ( 'should render asset opt-in transaction without sender auto-populated' , async ( ) => {
610+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
611+
612+ renderTxnsWizardPageWithSearchParams ( {
613+ searchParams : new URLSearchParams ( {
614+ 'type[0]' : 'axfer' ,
615+ 'assetid[0]' : assetId ,
616+ 'decimals[0]' : decimals ,
617+ 'unitname[0]' : unitName ,
618+ } ) ,
619+ } )
620+
621+ expect ( await screen . findByText ( assetId ) ) . toBeInTheDocument ( )
622+ expect ( await screen . findByText ( `0 ${ unitName } ` ) ) . toBeInTheDocument ( )
623+ // Find the yellow sender link (auto-populated)
624+ const senderLinks = await screen . findAllByText ( localnetDispenderAccount . addr . toString ( ) )
625+ expect ( senderLinks . some ( ( link ) => link . className . includes ( 'text-yellow-500' ) ) ) . toBe ( true )
626+ } )
627+
578628 it . each ( [
579629 // Missing required field cases
580630
@@ -755,6 +805,25 @@ describe('Render transactions page with search params', () => {
755805 expect ( await screen . findByText ( `0 ${ unitName } ` ) ) . toBeInTheDocument ( )
756806 } )
757807
808+ it ( 'should render asset opt-out transaction without sender - auto populate sender with localnet address' , async ( ) => {
809+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
810+
811+ renderTxnsWizardPageWithSearchParams ( {
812+ searchParams : new URLSearchParams ( {
813+ 'type[0]' : 'AssetOptOut' ,
814+ 'assetid[0]' : assetId ,
815+ 'closeto[0]' : closeto ,
816+ 'decimals[0]' : decimals ,
817+ } ) ,
818+ } )
819+
820+ expect ( await screen . findByText ( assetId ) ) . toBeInTheDocument ( )
821+ expect ( await screen . findByText ( closeto ) ) . toBeInTheDocument ( )
822+ // Find the yellow sender link (auto-populated)
823+ const senderLinks = await screen . findAllByText ( localnetDispenderAccount . addr . toString ( ) )
824+ expect ( senderLinks . some ( ( link ) => link . className . includes ( 'text-yellow-500' ) ) ) . toBe ( true )
825+ } )
826+
758827 it . each ( [
759828 // Missing required field cases
760829
@@ -959,6 +1028,27 @@ describe('Render transactions page with search params', () => {
9591028 expect ( await screen . findByText ( `${ amount } ${ unitName } ` ) ) . toBeInTheDocument ( )
9601029 } )
9611030
1031+ it ( 'should render asset transfer transaction without sender - auto populate sender with localnet address' , async ( ) => {
1032+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
1033+
1034+ renderTxnsWizardPageWithSearchParams ( {
1035+ searchParams : new URLSearchParams ( {
1036+ 'type[0]' : 'AssetTransfer' ,
1037+ 'receiver[0]' : receiver ,
1038+ 'assetid[0]' : assetId ,
1039+ 'amount[0]' : amount ,
1040+ 'decimals[0]' : decimals ,
1041+ } ) ,
1042+ } )
1043+
1044+ expect ( await screen . findByText ( receiver ) ) . toBeInTheDocument ( )
1045+ expect ( await screen . findByText ( assetId ) ) . toBeInTheDocument ( )
1046+ expect ( await screen . findByText ( amount ) ) . toBeInTheDocument ( )
1047+ // Find the yellow sender link (auto-populated)
1048+ const senderLinks = await screen . findAllByText ( localnetDispenderAccount . addr . toString ( ) )
1049+ expect ( senderLinks . some ( ( link ) => link . className . includes ( 'text-yellow-500' ) ) ) . toBe ( true )
1050+ } )
1051+
9621052 it . each ( [
9631053 // Missing required field cases
9641054
@@ -1389,6 +1479,24 @@ describe('Render transactions page with search params', () => {
13891479 expect ( await screen . findByText ( assetId ) ) . toBeInTheDocument ( )
13901480 } )
13911481
1482+ it ( 'should render asset destroy transaction without sender - auto populate sender with localnet address' , async ( ) => {
1483+ const localnetDispenderAccount = await localnet . algorand . account . localNetDispenser ( )
1484+
1485+ renderTxnsWizardPageWithSearchParams ( {
1486+ searchParams : new URLSearchParams ( {
1487+ 'type[0]' : 'AssetDestroy' ,
1488+ 'assetid[0]' : assetId ,
1489+ 'assetmanager[0]' : assetManager ,
1490+ 'decimals[0]' : decimals ,
1491+ } ) ,
1492+ } )
1493+
1494+ expect ( await screen . findByText ( assetId ) ) . toBeInTheDocument ( )
1495+ // Find the yellow sender link (auto-populated)
1496+ const senderLinks = await screen . findAllByText ( localnetDispenderAccount . addr . toString ( ) )
1497+ expect ( senderLinks . some ( ( link ) => link . className . includes ( 'text-yellow-500' ) ) ) . toBe ( true )
1498+ } )
1499+
13921500 it . each ( [
13931501 // Missing required field cases
13941502
0 commit comments