Commit 7227d6ad authored by Thong Kuah's avatar Thong Kuah

Merge branch 'display-notices-above-license-breakdown' into 'master'

Display notices above license breakdown

Closes #228962

See merge request gitlab-org/gitlab!36881
parents 726c3103 b2aba61c
- breadcrumb_title _("Dashboard")
- page_title _("Dashboard")
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
- if @notices
- @notices.each do |notice|
.js-vue-alert{ 'v-cloak': true, data: { variant: notice[:type],
dismissible: true.to_s } }
= notice[:message].html_safe
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
.admin-dashboard.gl-mt-3
.row
.col-sm-4
......
---
title: Display notices above license breakdown
merge_request: 36881
author:
type: changed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'admin/dashboard/index.html.haml' do
include Devise::Test::ControllerHelpers
before do
counts = Admin::DashboardController::COUNTED_ITEMS.each_with_object({}) do |item, hash|
hash[item] = 100
end
assign(:counts, counts)
assign(:projects, create_list(:project, 1))
assign(:users, create_list(:user, 1))
assign(:groups, create_list(:group, 1))
assign(:license, create(:license))
allow(view).to receive(:admin?).and_return(true)
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
allow(view).to receive(:show_license_breakdown?).and_return(true)
end
it 'includes notices above license breakdown' do
assign(:notices, [{ type: :alert, message: 'An alert' }])
render
expect(rendered).to have_content /An alert.*Users in License/
end
it 'includes license breakdown' do
render
expect(rendered).to have_content "Users in License"
expect(rendered).to have_content "Active Users"
expect(rendered).to have_content "Maximum Users"
expect(rendered).to have_content "Users over License"
end
end
......@@ -32,4 +32,13 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})"
end
it 'does not include license breakdown' do
render
expect(rendered).not_to have_content "Users in License"
expect(rendered).not_to have_content "Active Users"
expect(rendered).not_to have_content "Maximum Users"
expect(rendered).not_to have_content "Users over License"
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment