Welcome to mirror list, hosted at ThFree Co, Russian Federation.

multiple_assignees_mr_shared_examples.rb « features « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9d023d9514a5cf98e5418c841984b922a5741416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# frozen_string_literal: true

RSpec.shared_examples 'multiple assignees merge request' do |action, save_button_title|
  it "#{action} a MR with multiple assignees", :js do
    find('.js-assignee-search').click
    page.within '.dropdown-menu-user' do
      click_link user.name
      click_link user2.name
    end

    # Extra click needed in order to toggle the dropdown
    find('.js-assignee-search').click

    expect(all('input[name="merge_request[assignee_ids][]"]', visible: false).map(&:value))
      .to match_array([user.id.to_s, user2.id.to_s])

    page.within '.js-assignee-search' do
      expect(page).to have_content "#{user2.name} + 1 more"
    end

    click_button save_button_title

    page.within '.issuable-sidebar' do
      page.within '.assignee' do
        expect(page).to have_content '2 Assignees'

        click_link 'Edit'

        expect(page).to have_content user.name
        expect(page).to have_content user2.name
      end
    end

    page.within '.dropdown-menu-user' do
      click_link user.name
    end

    page.within '.issuable-sidebar' do
      page.within '.assignee' do
        # Closing dropdown to persist
        click_link 'Apply'

        expect(page).to have_content user2.name
      end
    end
  end
end