mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Add bulk destroy to admin users list (#29744)
This commit introduces a new feature that allows staff to bulk select and delete users directly from the users list at `/admin/users/list`. The main use-case for this feature is make deleting spammers easier when a site is under a large spam attack. Internal topic: t/140321.
This commit is contained in:
39
spec/system/page_objects/components/d_menu.rb
Normal file
39
spec/system/page_objects/components/d_menu.rb
Normal file
@ -0,0 +1,39 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
class DMenu < PageObjects::Components::Base
|
||||
attr_reader :component
|
||||
|
||||
def initialize(input)
|
||||
if input.is_a?(Capybara::Node::Element)
|
||||
@component = input
|
||||
else
|
||||
@component = find(input)
|
||||
end
|
||||
end
|
||||
|
||||
def expand
|
||||
raise "DMenu is already expanded" if is_expanded?
|
||||
component.click
|
||||
end
|
||||
|
||||
def collapse
|
||||
raise "DMenu is already collapsed" if is_collapsed?
|
||||
component.click
|
||||
end
|
||||
|
||||
def is_expanded?
|
||||
component["aria-expanded"] == "true"
|
||||
end
|
||||
|
||||
def is_collapsed?
|
||||
!is_expanded?
|
||||
end
|
||||
|
||||
def option(selector)
|
||||
within("#d-menu-portals") { find(selector) }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user