@@ -58,6 +58,48 @@ const setupTransferTest = async (page: Page): Promise<TransferTestContext> => {
5858}
5959
6060test . describe ( 'dashboard transfer flow' , ( ) => {
61+ test ( 'rejected approval returns the transfer form to a recoverable state' , async ( {
62+ page : dappPage ,
63+ } ) => {
64+ const { wg, bob } = await setupTransferTest ( dappPage )
65+
66+ await tap ( dappPage , wg , '200' )
67+ await openTransferDialog ( dappPage )
68+
69+ const dialog = dappPage . getByRole ( 'dialog' )
70+ await dialog
71+ . getByRole ( 'textbox' , { name : 'Recipient Address' } )
72+ . fill ( bob )
73+ await dialog . getByRole ( 'combobox' , { name : 'Select asset' } ) . click ( )
74+ await dappPage . getByRole ( 'option' , { name : / A M T / } ) . click ( )
75+ await dialog . getByRole ( 'spinbutton' , { name : 'Amount' } ) . fill ( '25' )
76+ await dialog
77+ . getByRole ( 'textbox' , { name : 'Description' } )
78+ . fill ( `rejected approval test ${ Date . now ( ) } ` )
79+
80+ const submitButton = dialog . getByRole ( 'button' , {
81+ name : 'Make Transfer' ,
82+ } )
83+ await wg . rejectTransaction ( ( ) => submitButton . click ( ) )
84+
85+ await expect ( dialog . getByRole ( 'alert' ) ) . toContainText (
86+ 'Transfer failed: The transaction was not completed. You can try again.' ,
87+ { timeout : 15000 }
88+ )
89+ await expect (
90+ dialog . getByRole ( 'heading' , { name : 'Transfer Summary' } )
91+ ) . not . toBeVisible ( )
92+ await expect (
93+ dialog . getByRole ( 'button' , { name : 'Close transfer dialog' } )
94+ ) . toBeEnabled ( )
95+ await expect ( submitButton ) . toBeEnabled ( )
96+
97+ await wg . approveTransaction ( ( ) => submitButton . click ( ) )
98+ await expect (
99+ dialog . getByRole ( 'heading' , { name : 'Transfer Summary' } )
100+ ) . toBeVisible ( { timeout : 15000 } )
101+ } )
102+
61103 test ( 'two step transfer - accept' , async ( { page : dappPage } ) => {
62104 const { wg, alice, bob } = await setupTransferTest ( dappPage )
63105
0 commit comments