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

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

require 'spec_helper'

RSpec.describe Sidebars::Groups::Menus::ScopeMenu, feature_category: :navigation do
  let(:group) { build(:group) }
  let(:user) { group.owner }
  let(:context) { Sidebars::Groups::Context.new(current_user: user, container: group) }
  let(:menu) { described_class.new(context) }

  describe '#extra_nav_link_html_options' do
    subject { menu.extra_nav_link_html_options }

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

  it_behaves_like 'serializable as super_sidebar_menu_args' do
    let(:extra_attrs) do
      {
        super_sidebar_parent: ::Sidebars::StaticMenu,
        title: group.name,
        avatar: group.avatar_url,
        entity_id: group.id,
        item_id: :group_overview
      }
    end
  end
end