summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb
blob: 301836f5ce8b548d5da7f66443a83626cf39da85 (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
# frozen_string_literal: true

module QA
  context 'Plan' do
    describe 'filter issue comments activities' do
      let(:issue_title) { 'issue title' }

      it 'user filters comments and activities in an issue' do
        Runtime::Browser.visit(:gitlab, Page::Main::Login)
        Page::Main::Login.act { sign_in_using_credentials }

        issue = Resource::Issue.fabricate_via_api! do |issue|
          issue.title = issue_title
        end

        issue.visit!

        expect(page).to have_content(issue_title)

        Page::Project::Issue::Show.perform do |show_page|
          my_own_comment = "My own comment"
          made_the_issue_confidential = "made the issue confidential"

          show_page.comment('/confidential', filter: :comments_only)
          show_page.comment(my_own_comment, filter: :comments_only)

          expect(show_page).not_to have_content(made_the_issue_confidential)
          expect(show_page).to have_content(my_own_comment)

          show_page.select_all_activities_filter

          expect(show_page).to have_content(made_the_issue_confidential)
          expect(show_page).to have_content(my_own_comment)

          show_page.select_history_only_filter

          expect(show_page).to have_content(made_the_issue_confidential)
          expect(show_page).not_to have_content(my_own_comment)
        end
      end
    end
  end
end