summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/2_plan/issue/real_time_assignee_spec.rb
blob: 26a83fc3caac7a6b17535462fa23a7391535b2b9 (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
48
49
50
51
52
53
# frozen_string_literal: true

module QA
  RSpec.describe 'Plan', :requires_admin, :actioncable, :orchestrated do
    describe 'Assignees' do
      let(:user1) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) }
      let(:user2) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) }
      let(:project) do
        Resource::Project.fabricate_via_api! do |project|
          project.name = 'project-to-test-assignees'
        end
      end

      before do
        Runtime::Feature.enable('real_time_issue_sidebar', project: project)
        Runtime::Feature.enable('broadcast_issue_updates', project: project)

        Flow::Login.sign_in

        project.add_member(user1)
        project.add_member(user2)
      end

      after do
        Runtime::Feature.disable('real_time_issue_sidebar', project: project)
        Runtime::Feature.disable('broadcast_issue_updates', project: project)
      end

      it 'update without refresh', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1048' do
        issue = Resource::Issue.fabricate_via_api! do |issue|
          issue.project = project
          issue.assignee_ids = [user1.id]
        end

        issue.visit!

        Page::Project::Issue::Show.perform do |show|
          expect(show).to have_assignee(user1.name)

          issue.set_issue_assignees(assignee_ids: [user2.id])

          expect(show).to have_assignee(user2.name)
          expect(show).to have_no_assignee_named(user1.name)

          issue.set_issue_assignees(assignee_ids: [])

          expect(show).to have_no_assignee_named(user1.name)
          expect(show).to have_no_assignee_named(user2.name)
        end
      end
    end
  end
end