|
3 | 3 | require 'spec_helper' |
4 | 4 | require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources' |
5 | 5 |
|
6 | | -describe "Roles", :js, type: :feature do |
| 6 | +describe "Roles", type: :feature do |
7 | 7 | before do |
8 | 8 | sign_in create(:admin_user, email: '[email protected]') |
9 | 9 | end |
|
25 | 25 | ) |
26 | 26 | } |
27 | 27 |
|
28 | | - include_examples 'feature: bulk delete resources' do |
29 | | - let(:resource_factory) { :role } |
30 | | - let(:index_path) { "/admin/roles" } |
31 | | - end |
32 | | - |
33 | | - it "lists roles and allows deleting them" do |
| 28 | + it "lists roles and allows deleting them", :js do |
34 | 29 | create(:role, name: "Customer Role" ) |
35 | 30 | Spree::Role.find_or_create_by(name: 'admin') |
36 | 31 |
|
|
62 | 57 | click_on "Add new" |
63 | 58 | expect(page).to have_selector("dialog", wait: 5) |
64 | 59 | expect(page).to have_content("New Role") |
| 60 | + end |
| 61 | + |
| 62 | + it "is accessible", :js do |
65 | 63 | expect(page).to be_axe_clean |
66 | 64 | end |
67 | 65 |
|
68 | | - it "closing the modal keeps query params" do |
| 66 | + it "closing the modal keeps query params", :js do |
69 | 67 | within("dialog") { click_on "Cancel" } |
70 | 68 | expect(page).not_to have_selector("dialog", wait: 5) |
71 | 69 | expect(page.current_url).to include(query) |
|
129 | 127 | click_on "Reviewer" |
130 | 128 | expect(page).to have_selector("dialog", wait: 5) |
131 | 129 | expect(page).to have_content("Edit Role") |
132 | | - expect(page).to be_axe_clean |
133 | 130 | expect(Spree::Role.find_by(name: "Reviewer").permission_set_ids) |
134 | | - .to contain_exactly(settings_edit_permission.id) |
| 131 | + .to contain_exactly(settings_edit_permission.id) |
| 132 | + end |
| 133 | + |
| 134 | + it "is accessible", :js do |
| 135 | + expect(page).to be_axe_clean |
135 | 136 | end |
136 | 137 |
|
137 | | - it "closing the modal keeps query params" do |
| 138 | + it "closing the modal keeps query params", :js do |
138 | 139 | within("dialog") { click_on "Cancel" } |
139 | 140 | expect(page).not_to have_selector("dialog", wait: 5) |
140 | 141 | expect(page.current_url).to include(query) |
|
0 commit comments