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

scope_menu_spec.rb « menus « projects « sidebars « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 108a98e28a4dd2e18d662790675218f992f7f9c0 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sidebars::Projects::Menus::ScopeMenu, feature_category: :navigation do
  let(:project) { build(:project) }
  let(:user) { project.first_owner }
  let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }

  it_behaves_like 'serializable as super_sidebar_menu_args' do
    let(:menu) { described_class.new(context) }
    let(:extra_attrs) do
      {
        title: project.name,
        avatar: project.avatar_url,
        entity_id: project.id,
        super_sidebar_parent: ::Sidebars::StaticMenu,
        item_id: :project_overview
      }
    end
  end

  describe '#container_html_options' do
    subject { described_class.new(context).container_html_options }

    specify { is_expected.to match(hash_including(class: 'shortcuts-project')) }
  end

  describe '#extra_nav_link_html_options' do
    subject { described_class.new(context).extra_nav_link_html_options }

    specify { is_expected.to match(hash_including(class: 'context-header has-tooltip', title: context.project.name)) }
  end
end