diff options
Diffstat (limited to 'spec/features/projects/work_items/work_item_spec.rb')
-rw-r--r-- | spec/features/projects/work_items/work_item_spec.rb | 95 |
1 files changed, 79 insertions, 16 deletions
diff --git a/spec/features/projects/work_items/work_item_spec.rb b/spec/features/projects/work_items/work_item_spec.rb index 33153d21575..9ce068c2ea1 100644 --- a/spec/features/projects/work_items/work_item_spec.rb +++ b/spec/features/projects/work_items/work_item_spec.rb @@ -41,23 +41,62 @@ RSpec.describe 'Work item', :js, feature_category: :team_planning do expect(page).to have_button _('More actions') end - it 'reassigns to another user', - quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/413074' do - find('[data-testid="work-item-assignees-input"]').fill_in(with: user.username) - wait_for_requests + context 'when work_items_mvc_2 is disabled' do + before do + stub_feature_flags(work_items_mvc_2: false) - send_keys(:enter) - find("body").click - wait_for_requests + page.refresh + wait_for_all_requests + end + + it 'reassigns to another user', + quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/413074' do + find('[data-testid="work-item-assignees-input"]').fill_in(with: user.username) + wait_for_requests + + send_keys(:enter) + find("body").click + wait_for_requests + + find('[data-testid="work-item-assignees-input"]').fill_in(with: user2.username) + wait_for_requests + + send_keys(:enter) + find("body").click + wait_for_requests + + expect(work_item.reload.assignees).to include(user2) + end + end + + context 'when work_items_mvc_2 is enabled' do + before do + stub_feature_flags(work_items_mvc_2: true) + + page.refresh + wait_for_all_requests + end + + it 'reassigns to another user', + quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/413074' do + within('[data-testid="work-item-assignees-with-edit"]') do + click_button 'Edit' + end + + select_listbox_item(user.username) - find('[data-testid="work-item-assignees-input"]').fill_in(with: user2.username) - wait_for_requests + wait_for_requests - send_keys(:enter) - find("body").click - wait_for_requests + within('[data-testid="work-item-assignees-with-edit"]') do + click_button 'Edit' + end - expect(work_item.reload.assignees).to include(user2) + select_listbox_item(user2.username) + + wait_for_requests + + expect(work_item.reload.assignees).to include(user2) + end end it_behaves_like 'work items title' @@ -118,9 +157,33 @@ RSpec.describe 'Work item', :js, feature_category: :team_planning do expect(page).to have_selector('[data-testid="award-button"].disabled') end - it 'assignees input field is disabled' do - within('[data-testid="work-item-assignees-input"]') do - expect(page).to have_field(type: 'text', disabled: true) + context 'when work_items_mvc_2 is disabled' do + before do + stub_feature_flags(work_items_mvc_2: false) + + page.refresh + wait_for_all_requests + end + + it 'assignees input field is disabled' do + within('[data-testid="work-item-assignees-input"]') do + expect(page).to have_field(type: 'text', disabled: true) + end + end + end + + context 'when work_items_mvc_2 is enabled' do + before do + stub_feature_flags(work_items_mvc_2: true) + + page.refresh + wait_for_all_requests + end + + it 'assignees edit button is not visible' do + within('[data-testid="work-item-assignees-with-edit"]') do + expect(page).not_to have_button('Edit') + end end end |