debian-mirror-gitlab/spec/views/layouts/fullscreen.html.haml_spec.rb

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

55 lines
1.4 KiB
Ruby
Raw Normal View History

2022-08-13 15:12:31 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/fullscreen' do
let_it_be(:user) { create(:user) }
before do
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
2022-10-11 01:57:18 +05:30
it 'renders a flex container' do
render
expect(rendered).to have_selector(".gl--flex-full.gl-h-full")
expect(rendered).to have_selector(".gl--flex-full.gl-w-full")
end
2022-08-13 15:12:31 +05:30
it_behaves_like 'a layout which reflects the application theme setting'
2022-10-11 01:57:18 +05:30
describe 'sidebar' do
context 'when nav is set' do
before do
allow(view).to receive(:nav).and_return("admin")
render
end
it 'renders the sidebar' do
expect(rendered).to render_template("layouts/nav/sidebar/_admin")
expect(rendered).to have_selector("aside.nav-sidebar")
end
it 'adds the proper classes' do
expect(rendered).to have_selector(".layout-page.gl-mt-0\\!")
end
end
describe 'when nav is not set' do
before do
allow(view).to receive(:nav).and_return(nil)
render
end
it 'does not render the sidebar' do
expect(rendered).not_to render_template("layouts/nav/sidebar/_admin")
expect(rendered).not_to have_selector("aside.nav-sidebar")
end
it 'not add classes' do
expect(rendered).not_to have_selector(".layout-page.gl-mt-0\\!")
end
end
end
2022-08-13 15:12:31 +05:30
end