@@ -471,3 +471,147 @@ test('Wrapped, emancipated(NPC), 3LD Manager', async ({ login, makeName, makePag
471471 await transactionModal . autoComplete ( )
472472 await expect ( morePage . wrapButton ) . toBeVisible ( )
473473} )
474+
475+ test ( 'Should not show wrap button on unwrapped name in Grace period' , async ( {
476+ login,
477+ makeName,
478+ makePageObject,
479+ } ) => {
480+ const name = await makeName ( {
481+ label : 'to-be-wrapped' ,
482+ type : 'legacy' ,
483+ duration : - 24 * 60 * 60 ,
484+ } )
485+
486+ const morePage = makePageObject ( 'MorePage' )
487+ await morePage . goto ( name )
488+
489+ await login . connect ( )
490+
491+ await expect ( morePage . wrapButton ) . not . toBeVisible ( )
492+ await expect ( morePage . wrapButton ) . toHaveCount ( 0 )
493+ } )
494+
495+ test ( 'should show wrap button on unwrapped subname in Grace period' , async ( {
496+ login,
497+ makeName,
498+ makePageObject,
499+ } ) => {
500+ const name = await makeName ( {
501+ label : 'to-be-wrapped' ,
502+ type : 'legacy' ,
503+ subnames : [
504+ {
505+ label : 'sub' ,
506+ } ,
507+ ] ,
508+ duration : - 24 * 60 * 60 ,
509+ } )
510+
511+ const morePage = makePageObject ( 'MorePage' )
512+ const transactionModal = makePageObject ( 'TransactionModal' )
513+ await morePage . goto ( `sub.${ name } ` )
514+
515+ await login . connect ( )
516+
517+ await expect ( morePage . wrapButton ) . toBeVisible ( )
518+ await expect ( morePage . wrapButton ) . toBeEnabled ( )
519+
520+ await morePage . wrapButton . click ( )
521+ await transactionModal . autoComplete ( )
522+
523+ await morePage . goto ( `sub.${ name } ` )
524+ await expect ( morePage . wrapButton ) . toHaveCount ( 0 )
525+ } )
526+
527+ test ( 'should not show unwrap button on wrapped name in Grace period' , async ( {
528+ login,
529+ makeName,
530+ makePageObject,
531+ } ) => {
532+ const name = await makeName ( {
533+ label : 'wrapped' ,
534+ type : 'wrapped' ,
535+ duration : - 24 * 60 * 60 ,
536+ } )
537+
538+ const morePage = makePageObject ( 'MorePage' )
539+ await morePage . goto ( name )
540+
541+ await login . connect ( )
542+
543+ await expect ( morePage . unwrapButton ) . toHaveCount ( 0 )
544+ } )
545+
546+ test ( 'should show unwrap button on wrapped subname in Grace period' , async ( {
547+ login,
548+ makeName,
549+ makePageObject,
550+ } ) => {
551+ const name = await makeName ( {
552+ label : 'to-be-wrapped' ,
553+ type : 'wrapped' ,
554+ owner : 'user' ,
555+ subnames : [
556+ {
557+ label : 'sub' ,
558+ owner : 'user' ,
559+ } ,
560+ ] ,
561+ duration : - 24 * 60 * 60 ,
562+ } )
563+
564+ const morePage = makePageObject ( 'MorePage' )
565+ const transactionModal = makePageObject ( 'TransactionModal' )
566+ await morePage . goto ( `sub.${ name } ` )
567+
568+ await login . connect ( )
569+
570+ await expect ( morePage . unwrapButton ) . toBeVisible ( )
571+ await expect ( morePage . unwrapButton ) . toBeEnabled ( )
572+
573+ await morePage . unwrapButton . click ( )
574+ await transactionModal . autoComplete ( )
575+
576+ await morePage . goto ( `sub.${ name } ` )
577+ await expect ( morePage . unwrapButton ) . toHaveCount ( 0 )
578+ } )
579+
580+ test ( 'Wrapped, emancipated(NPC), 3LD Manager should be able to unwrap when parent is in Grace period' , async ( {
581+ login,
582+ makeName,
583+ makePageObject,
584+ } ) => {
585+ const name = await makeName ( {
586+ label : 'wrapped' ,
587+ type : 'wrapped' ,
588+ owner : 'user2' ,
589+ fuses : {
590+ named : [ 'CANNOT_UNWRAP' ] ,
591+ } ,
592+ subnames : [
593+ {
594+ label : 'test' ,
595+ owner : 'user' ,
596+ fuses : {
597+ parent : {
598+ named : [ 'PARENT_CANNOT_CONTROL' ] ,
599+ } ,
600+ } ,
601+ } ,
602+ ] ,
603+ duration : - 24 * 60 * 60 ,
604+ } )
605+
606+ const morePage = makePageObject ( 'MorePage' )
607+ const transactionModal = makePageObject ( 'TransactionModal' )
608+ await morePage . goto ( `test.${ name } ` )
609+
610+ await login . connect ( )
611+
612+ await expect ( morePage . unwrapButton ) . toBeVisible ( )
613+ await expect ( morePage . unwrapButton ) . toBeEnabled ( )
614+ await morePage . unwrapButton . click ( )
615+ await transactionModal . autoComplete ( )
616+ await expect ( morePage . wrapButton ) . toBeVisible ( )
617+ } )
0 commit comments