diff --git a/spec/support/shared_examples/features/work_items_shared_examples.rb b/spec/support/shared_examples/features/work_items_shared_examples.rb index 1b90009b7a3b9ddb34362b61f797701cf06a68ce..bfa9b8fbee9d8bf9e4048291b8b0f096b384514c 100644 --- a/spec/support/shared_examples/features/work_items_shared_examples.rb +++ b/spec/support/shared_examples/features/work_items_shared_examples.rb @@ -343,12 +343,23 @@ def click_reply_and_enter_slash RSpec.shared_examples 'work items milestone' do let(:work_item_milestone_selector) { '[data-testid="work-item-milestone-with-edit"]' } - it 'passes axe automated accessibility testing in closed state' do - find(work_item_milestone_selector) + it 'has the work item milestone with edit' do + expect(page).to have_selector(work_item_milestone_selector) + end + it 'passes axe automated accessibility testing in closed state' do expect(page).to be_axe_clean.within(work_item_milestone_selector) end + it 'passes axe automated accessibility testing in open state' do + within(work_item_milestone_selector) do + click_button _('Edit') + wait_for_requests + + expect(page).to be_axe_clean.within(work_item_milestone_selector) + end + end + context 'when edit is clicked' do it 'selects and updates the right milestone', :aggregate_failures do find_and_click_edit(work_item_milestone_selector) @@ -565,22 +576,20 @@ def find_and_click_clear(selector) ) end - context 'for accessibility' do - it 'has the work item iteration with edit' do - expect(page).to have_selector(work_item_iteration_selector) - end + it 'has the work item iteration with edit' do + expect(page).to have_selector(work_item_iteration_selector) + end - it 'passes axe automated accessibility testing in closed state' do - expect(page).to be_axe_clean.within(work_item_iteration_selector) - end + it 'passes axe automated accessibility testing in closed state' do + expect(page).to be_axe_clean.within(work_item_iteration_selector) + end - it 'passes axe automated accessibility testing in open state' do - within(work_item_iteration_selector) do - click_button _('Edit') - wait_for_requests + it 'passes axe automated accessibility testing in open state' do + within(work_item_iteration_selector) do + click_button _('Edit') + wait_for_requests - expect(page).to be_axe_clean.within(work_item_iteration_selector) - end + expect(page).to be_axe_clean.within(work_item_iteration_selector) end end @@ -636,19 +645,17 @@ def find_and_click_clear(selector) include_context 'with work_items_rolledup_dates', true - context 'for accessibility' do - it 'passes axe automated accessibility testing in closed state' do - expect(page).to have_selector(work_item_rolledup_dates_selector) - expect(page).to be_axe_clean.within(work_item_rolledup_dates_selector) - end + it 'passes axe automated accessibility testing in closed state' do + expect(page).to have_selector(work_item_rolledup_dates_selector) + expect(page).to be_axe_clean.within(work_item_rolledup_dates_selector) + end - it 'passes axe automated accessibility testing in open state' do - within(work_item_rolledup_dates_selector) do - click_button _('Edit') - wait_for_requests + it 'passes axe automated accessibility testing in open state' do + within(work_item_rolledup_dates_selector) do + click_button _('Edit') + wait_for_requests - expect(page).to be_axe_clean.within(work_item_rolledup_dates_selector) - end + expect(page).to be_axe_clean.within(work_item_rolledup_dates_selector) end end