Make select all checkbox on users list work with turbo

This commit is contained in:
Tom Hughes 2024-09-12 19:09:47 +01:00
parent 4f2789c73c
commit 6d49bc6ebb
3 changed files with 35 additions and 4 deletions

28
test/system/users_test.rb Normal file
View file

@ -0,0 +1,28 @@
require "application_system_test_case"
class UsersTest < ApplicationSystemTestCase
def setup
admin = create(:administrator_user)
sign_in_as(admin)
end
test "all users can be selected" do
create_list(:user, 100)
visit users_path
assert_css "tbody input[type=checkbox]:checked", :count => 0
assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
check "user_all"
assert_css "tbody input[type=checkbox]:checked", :count => 50
assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
click_on "Older Users", :match => :first
assert_css "tbody input[type=checkbox]:checked", :count => 0
assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
check "user_all"
assert_css "tbody input[type=checkbox]:checked", :count => 50
assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
end
end