@@ -1151,4 +1151,51 @@ test.describe('Wrapped Name Renewal with Referrer', () => {
11511151 // Note: Bulk renewals should use the legacy bulk renewal contract
11521152 // which doesn't support referrers
11531153 } )
1154+
1155+ test ( 'should extend wrapped name in grace period with referrer' , async ( {
1156+ page,
1157+ login,
1158+ makeName,
1159+ makePageObject,
1160+ } ) => {
1161+ const name = await makeName ( {
1162+ label : 'wrapped-grace-referrer' ,
1163+ type : 'wrapped' ,
1164+ owner : 'user' ,
1165+ duration : - 24 * 60 * 60 , // Expired 1 day ago
1166+ } )
1167+
1168+ const referrerAddress = '0x1234567890123456789012345678901234567890'
1169+
1170+ const profilePage = makePageObject ( 'ProfilePage' )
1171+ const transactionModal = makePageObject ( 'TransactionModal' )
1172+
1173+ await profilePage . goto ( name )
1174+ await login . connect ( )
1175+
1176+ // Verify name is in grace period
1177+ await expect ( page . getByText ( `${ name } has expired` ) ) . toBeVisible ( )
1178+
1179+ // Add referrer to URL and navigate
1180+ await page . goto ( `/${ name } ?referrer=${ referrerAddress } ` )
1181+
1182+ // Click extend button
1183+ await profilePage . getExtendButton . click ( )
1184+
1185+ // Set extension and proceed
1186+ await expect ( page . getByTestId ( 'plus-minus-control-label' ) ) . toHaveText ( '1 year' )
1187+ await page . locator ( 'button:has-text("Next")' ) . click ( )
1188+
1189+ // Complete transaction
1190+ await transactionModal . confirm ( )
1191+
1192+ await expect ( page . getByText ( 'Your "Extend names" transaction was successful' ) ) . toBeVisible ( {
1193+ timeout : 10000 ,
1194+ } )
1195+
1196+ // Verify referrer included in the transaction calldata
1197+ const latestTransaction = await publicClient . getTransaction ( { blockTag : 'latest' , index : 0 } )
1198+ const referrerHex = addressToBytes32 ( referrerAddress )
1199+ expect ( latestTransaction . input ) . toContain ( referrerHex . slice ( 2 ) ) // Remove '0x' prefix for comparison
1200+ } )
11541201} )
0 commit comments