@@ -62,7 +62,7 @@ Feature: Admin Actions for Works, Comments, Series, Bookmarks
62
62
Scenario Outline : Can unhide works
63
63
Given I am logged in as "regular_user"
64
64
And I post the work "ToS Violation"
65
- When I am logged in as a "policy_and_abuse " admin
65
+ When I am logged in as a "<role> " admin
66
66
And I view the work "ToS Violation"
67
67
And I follow "Hide Work"
68
68
And all indexing jobs have been run
@@ -541,3 +541,115 @@ Feature: Admin Actions for Works, Comments, Series, Bookmarks
541
541
| superadmin |
542
542
| legal |
543
543
| policy_and_abuse |
544
+
545
+ Scenario Outline : Certain admins can remove orphan_account pseuds from works
546
+ Given I have an orphan account
547
+ And I am logged in as "Leaver"
548
+ And I post the work "Bye"
549
+ And I orphan and keep my pseud on the work "Bye"
550
+ When I am logged in as a "<role>" admin
551
+ And I view the work "Bye"
552
+ Then I should see "Remove Pseud"
553
+ When I follow "Remove Pseud"
554
+ Then I should see "Are you sure you want to remove the creator's pseud from this work?"
555
+ # Expire byline cache
556
+ When it is currently 1 second from now
557
+ And I press "Yes, Remove Pseud"
558
+ Then I should see "Successfully removed pseud Leaver (orphan_account) from this work."
559
+ And I should see "orphan_account" within ".byline"
560
+ But I should not see "Leaver" within ".byline"
561
+
562
+ Examples :
563
+ | role |
564
+ | superadmin |
565
+ | policy_and_abuse |
566
+ | support |
567
+
568
+ @javascript
569
+ Scenario Outline : Removing orphan_account pseuds from works with JavaScript shows a confirmation pop-up instead of a page
570
+ Given I have an orphan account
571
+ And I am logged in as "Leaver"
572
+ And I post the work "Bye"
573
+ And I orphan and keep my pseud on the work "Bye"
574
+ When I am logged in as a "<role>" admin
575
+ And I view the work "Bye"
576
+ Then I should see "Remove Pseud"
577
+ # Expire byline cache
578
+ When it is currently 1 second from now
579
+ And I follow "Remove Pseud"
580
+ And I confirm I want to remove the pseud
581
+ Then I should see "Successfully removed pseud Leaver (orphan_account) from this work."
582
+ And I should see "orphan_account" within ".byline"
583
+ But I should not see "Leaver" within ".byline"
584
+
585
+ Examples :
586
+ | role |
587
+ | superadmin |
588
+ | policy_and_abuse |
589
+ | support |
590
+
591
+ Scenario : When removing orphan_account pseuds from a work with multiple pseuds admins choose which pseud to remove
592
+ Given I have an orphan account
593
+ And I am logged in as "Leaver"
594
+ And I post the work "Bye"
595
+ And I add the co-author "Another" to the work "Bye"
596
+ And it is currently 1 second from now
597
+ And I add the co-author "Third" to the work "Bye"
598
+ And I orphan and keep my pseud on the work "Bye"
599
+ And I am logged in as "Another"
600
+ And I orphan and keep my pseud on the work "Bye"
601
+ And I am logged in as "Third"
602
+ And I orphan and keep my pseud on the work "Bye"
603
+ When I am logged in as a "policy_and_abuse" admin
604
+ And I view the work "Bye"
605
+ Then I should see "Remove Pseud"
606
+ When I follow "Remove Pseud"
607
+ Then I should see "Please choose which creators' pseuds you would like to remove from this work."
608
+ And I should see "Third (orphan_account)"
609
+ When I check "Leaver (orphan_account)"
610
+ And I check "Another (orphan_account)"
611
+ # Expire byline cache
612
+ And it is currently 1 second from now
613
+ And I press "Remove Pseud"
614
+ Then I should see "Successfully removed pseuds Leaver (orphan_account) and Another (orphan_account) from this work."
615
+ And I should see "orphan_account, " within ".byline"
616
+ And I should see "Third (orphan_account)" within ".byline"
617
+ But I should not see "Leaver" within ".byline"
618
+ And I should not see "Another" within ".byline"
619
+ When I go to the admin-activities page
620
+ Then I should see 1 admin activity log entry
621
+ And I should see "remove orphan_account pseuds"
622
+
623
+ Scenario : The Remove pseud option is only shown on orphaned works with non-default pseuds
624
+ Given I have an orphan account
625
+ And I am logged in as "Leaver"
626
+ And I post the work "Hey"
627
+ And I post the work "Bye"
628
+ And I orphan and take my pseud off the work "Bye"
629
+ When I am logged in as a "superadmin" admin
630
+ And I view the work "Hey"
631
+ Then I should not see "Remove Pseud"
632
+ When I view the work "Bye"
633
+ Then I should not see "Remove Pseud"
634
+
635
+ Scenario Outline : The Remove pseud option is not shown to admins who don't have permissions to remove pseuds
636
+ Given I have an orphan account
637
+ And I am logged in as "Leaver"
638
+ And I post the work "Bye"
639
+ And I orphan and keep my pseud on the work "Bye"
640
+ When I am logged in as a "<role>" admin
641
+ And I view the work "Bye"
642
+ Then I should not see "Remove Pseud"
643
+
644
+ Examples :
645
+ | role |
646
+ | board |
647
+ | board_assistants_team |
648
+ | communications |
649
+ | development_and_membership |
650
+ | docs |
651
+ | elections |
652
+ | legal |
653
+ | translation |
654
+ | tag_wrangling |
655
+ | open_doors |
0 commit comments