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

navbar_spec.rb « projects « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dabb2b2dbf20d83dd17166de922102c61823ed30 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# frozen_string_literal: true

require 'spec_helper'

describe 'Project navbar' do
  let(:user) { create(:user) }
  let(:project) { create(:project, :repository) }

  let(:analytics_nav_item) do
    {
      nav_item: _('Analytics'),
      nav_sub_items: [
        _('CI / CD'),
        (_('Code Review') if Gitlab.ee?),
        _('Repository'),
        _('Value Stream')
      ]
    }
  end

  let(:structure) do
    [
      {
        nav_item: _('Project overview'),
        nav_sub_items: [
          _('Details'),
          _('Activity'),
          _('Releases')
        ]
      },
      {
        nav_item: _('Repository'),
        nav_sub_items: [
          _('Files'),
          _('Commits'),
          _('Branches'),
          _('Tags'),
          _('Contributors'),
          _('Graph'),
          _('Compare'),
          (_('Locked Files') if Gitlab.ee?)
        ]
      },
      {
        nav_item: _('Issues'),
        nav_sub_items: [
          _('List'),
          _('Boards'),
          _('Labels'),
          _('Milestones')
        ]
      },
      {
        nav_item: _('Merge Requests'),
        nav_sub_items: []
      },
      {
        nav_item: _('CI / CD'),
        nav_sub_items: [
          _('Pipelines'),
          _('Jobs'),
          _('Artifacts'),
          _('Schedules')
        ]
      },
      {
        nav_item: _('Operations'),
        nav_sub_items: [
          _('Metrics'),
          _('Environments'),
          _('Error Tracking'),
          _('Serverless'),
          _('Kubernetes')
        ]
      },
      analytics_nav_item,
      {
        nav_item: _('Wiki'),
        nav_sub_items: []
      },
      {
        nav_item: _('Snippets'),
        nav_sub_items: []
      },
      {
        nav_item: _('Settings'),
        nav_sub_items: [
          _('General'),
          _('Members'),
          _('Integrations'),
          _('Webhooks'),
          _('Repository'),
          _('CI / CD'),
          _('Operations'),
          (_('Audit Events') if Gitlab.ee?)
        ].compact
      }
    ]
  end

  before do
    project.add_maintainer(user)
    sign_in(user)
  end

  it_behaves_like 'verified navigation bar' do
    before do
      visit project_path(project)
    end
  end

  if Gitlab.ee?
    context 'when issues analytics is available' do
      before do
        stub_licensed_features(issues_analytics: true)

        analytics_nav_item[:nav_sub_items] << _('Issues')
        analytics_nav_item[:nav_sub_items].sort!

        visit project_path(project)
      end

      it_behaves_like 'verified navigation bar'
    end
  end
end