Skip to content
Snippets Groups Projects
Commit bdd48f2b authored by Simon Knox's avatar Simon Knox
Browse files

Add feature flag to remove startup CSS

parent 0efbca76
No related branches found
No related tags found
2 merge requests!118700Remove refactor_vulnerability_filters feature flag,!117495Add feature flag to remove startup CSS
......@@ -281,7 +281,7 @@ def stylesheet_link_tag_defer(path)
end
def startup_css_enabled?
!params.has_key?(:no_startup_css)
!Feature.enabled?(:remove_startup_css) && !params.has_key?(:no_startup_css)
end
def sign_in_with_redirect?
......
---
name: remove_startup_css
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117495
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/407140
milestone: '16.0'
type: development
group: group::project management
default_enabled: false
......@@ -696,10 +696,18 @@ def stub_controller_method(method_name, value)
end
describe 'stylesheet_link_tag_defer' do
it 'uses print stylesheet by default' do
it 'uses print stylesheet when feature flag disabled' do
stub_feature_flags(remove_startup_css: false)
expect(helper.stylesheet_link_tag_defer('test')).to eq( '<link rel="stylesheet" media="print" href="/stylesheets/test.css" />')
end
it 'uses regular stylesheet when feature flag disabled' do
stub_feature_flags(remove_startup_css: true)
expect(helper.stylesheet_link_tag_defer('test')).to eq( '<link rel="stylesheet" media="screen" href="/stylesheets/test.css" />')
end
it 'uses regular stylesheet when no_startup_css param present' do
allow(helper.controller).to receive(:params).and_return({ no_startup_css: '' })
......
......@@ -59,7 +59,7 @@
render
expect(rendered).to match('<link rel="stylesheet" media="print" href="/stylesheets/highlight/themes/solarised-light.css" />')
expect(rendered).to match('<link rel="stylesheet" media="screen" href="/stylesheets/highlight/themes/solarised-light.css" />')
end
context 'when an asset_host is set and snowplow url is set', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/346542' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment