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

admin_dev_ops_report_spec.rb « admin « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b2c9d758704f42463e39e718467e95126baf425 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'DevOps Report page', :js do
  before do
    sign_in(create(:admin))
  end

  context 'with devops_adoption feature flag disabled' do
    before do
      stub_feature_flags(devops_adoption: false)
    end

    it 'has dismissable intro callout' do
      visit admin_dev_ops_report_path

      expect(page).to have_content 'Introducing Your DevOps Report'

      find('.js-close-callout').click

      expect(page).not_to have_content 'Introducing Your DevOps Report'
    end

    context 'when usage ping is disabled' do
      before do
        stub_application_setting(usage_ping_enabled: false)
      end

      it 'shows empty state' do
        visit admin_dev_ops_report_path

        expect(page).to have_selector(".js-empty-state")
      end

      it 'hides the intro callout' do
        visit admin_dev_ops_report_path

        expect(page).not_to have_content 'Introducing Your DevOps Report'
      end
    end

    context 'when there is no data to display' do
      it 'shows empty state' do
        stub_application_setting(usage_ping_enabled: true)

        visit admin_dev_ops_report_path

        expect(page).to have_content('Data is still calculating')
      end
    end

    context 'when there is data to display' do
      it 'shows numbers for each metric' do
        stub_application_setting(usage_ping_enabled: true)
        create(:dev_ops_report_metric)

        visit admin_dev_ops_report_path

        expect(page).to have_content(
          'Issues created per active user 1.2 You 9.3 Lead 13.3%'
        )
      end
    end
  end
end