debian-mirror-gitlab/spec/lib/sidebars/search/panel_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
893 B
Ruby
Raw Permalink Normal View History

2023-06-20 00:43:36 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Sidebars::Search::Panel, feature_category: :navigation do
let_it_be(:current_user) { create(:user) }
let_it_be(:user) { create(:user) }
let(:context) { Sidebars::Context.new(current_user: current_user, container: user) }
let(:panel) { described_class.new(context) }
subject { described_class.new(context) }
2023-07-09 08:55:56 +05:30
it_behaves_like 'a panel with uniquely identifiable menu items'
2023-06-20 00:43:36 +05:30
describe '#aria_label' do
it 'returns the correct aria label' do
2023-07-09 08:55:56 +05:30
expect(panel.aria_label).to eq(_('Search results'))
2023-06-20 00:43:36 +05:30
end
end
describe '#super_sidebar_context_header' do
it 'returns a hash with the correct title and icon' do
expected_header = {
2023-07-09 08:55:56 +05:30
title: 'Search results',
icon: 'search-results'
2023-06-20 00:43:36 +05:30
}
expect(panel.super_sidebar_context_header).to eq(expected_header)
end
end
end