diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/helpers/issuables_helper_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/helpers/issuables_helper_spec.rb')
-rw-r--r-- | spec/helpers/issuables_helper_spec.rb | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index 15b57a4c9eb..f2e3e401766 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -112,19 +112,7 @@ RSpec.describe IssuablesHelper do context 'when assigned issues count is over 100' do let_it_be(:issues) { create_list(:issue, 101, project: project, assignees: [user]) } - before do - stub_feature_flags(limit_assigned_issues_count: false) - end - - it { is_expected.to eq 101 } - - context 'when FF limit_assigned_issues_count is enabled' do - before do - stub_feature_flags(limit_assigned_issues_count: true) - end - - it { is_expected.to eq 100 } - end + it { is_expected.to eq 100 } end end end @@ -142,19 +130,7 @@ RSpec.describe IssuablesHelper do context 'when assigned issues count is over 99' do let_it_be(:issues) { create_list(:issue, 100, project: project, assignees: [user]) } - before do - stub_feature_flags(limit_assigned_issues_count: false) - end - - it { is_expected.to eq '100' } - - context 'when FF limit_assigned_issues_count is enabled' do - before do - stub_feature_flags(limit_assigned_issues_count: true) - end - - it { is_expected.to eq '99+' } - end + it { is_expected.to eq '99+' } end end @@ -629,4 +605,28 @@ RSpec.describe IssuablesHelper do expect(helper.sidebar_milestone_tooltip_label(milestone)).to eq('<img onerror=alert(1)><br/>Milestone') end end + + describe '#hidden_issuable_icon', feature_category: :insider_threat do + let_it_be(:mock_svg) { '<svg></svg>'.html_safe } + + before do + allow(helper).to receive(:sprite_icon).and_return(mock_svg) + end + + context 'when issuable is an issue' do + let_it_be(:issuable) { build(:issue) } + + it 'returns icon with tooltip' do + expect(helper.hidden_issuable_icon(issuable)).to eq("<span class=\"has-tooltip\" title=\"This issue is hidden because its author has been banned\">#{mock_svg}</span>") + end + end + + context 'when issuable is a merge request' do + let_it_be(:issuable) { build(:merge_request) } + + it 'returns icon with tooltip' do + expect(helper.hidden_issuable_icon(issuable)).to eq("<span class=\"has-tooltip\" title=\"This merge request is hidden because its author has been banned\">#{mock_svg}</span>") + end + end + end end |