Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a79f58bc
Commit
a79f58bc
authored
Mar 23, 2021
by
Michael Lunøe
Committed by
Dylan Griffith
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix(EoA Banner): add test coverage + log error
Add test coverage for when user actually dismisses the banner
parent
cffdff1f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
app/assets/javascripts/persistent_user_callouts.js
app/assets/javascripts/persistent_user_callouts.js
+1
-0
ee/app/helpers/ee/user_callouts_helper.rb
ee/app/helpers/ee/user_callouts_helper.rb
+2
-1
ee/app/views/shared/billings/_eoa_bronze_plan_banner.html.haml
...p/views/shared/billings/_eoa_bronze_plan_banner.html.haml
+1
-1
ee/spec/features/billings/billing_plans_spec.rb
ee/spec/features/billings/billing_plans_spec.rb
+29
-0
ee/spec/views/shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb
...shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb
+8
-0
No files found.
app/assets/javascripts/persistent_user_callouts.js
View file @
a79f58bc
...
...
@@ -8,6 +8,7 @@ const PERSISTENT_USER_CALLOUTS = [
'
.js-token-expiry-callout
'
,
'
.js-registration-enabled-callout
'
,
'
.js-new-user-signups-cap-reached
'
,
'
.js-eoa-bronze-plan-banner
'
,
];
const
initCallouts
=
()
=>
{
...
...
ee/app/helpers/ee/user_callouts_helper.rb
View file @
a79f58bc
...
...
@@ -12,6 +12,7 @@ module EE
NEW_USER_SIGNUPS_CAP_REACHED
=
'new_user_signups_cap_reached'
PERSONAL_ACCESS_TOKEN_EXPIRY
=
'personal_access_token_expiry'
EOA_BRONZE_PLAN_BANNER
=
'eoa_bronze_plan_banner'
EOA_BRONZE_PLAN_END_DATE
=
'2022-01-26'
def
render_enable_hashed_storage_warning
return
unless
show_enable_hashed_storage_warning?
...
...
@@ -91,7 +92,7 @@ module EE
private
def
eoa_bronze_plan_end_date
Date
.
parse
(
'2022-01-26'
)
Date
.
parse
(
EOA_BRONZE_PLAN_END_DATE
)
end
def
hashed_storage_enabled?
...
...
ee/app/views/shared/billings/_eoa_bronze_plan_banner.html.haml
View file @
a79f58bc
-
if
show_eoa_bronze_plan_banner?
(
namespace
)
.container-fluid.container-limited.pt-3
.gl-alert.gl-alert-info.gl-mt-5
{
role:
'alert'
,
data:
{
feature_id:
::
EE
::
UserCalloutsHelper
::
EOA_BRONZE_PLAN_BANNER
,
dismiss_endpoint:
user_callouts_path
}
}
.gl-alert.gl-alert-info.gl-mt-5
.js-eoa-bronze-plan-banner
{
role:
'alert'
,
data:
{
feature_id:
::
EE
::
UserCalloutsHelper
::
EOA_BRONZE_PLAN_BANNER
,
dismiss_endpoint:
user_callouts_path
}
}
=
sprite_icon
(
'information-o'
,
css_class:
'gl-icon gl-alert-icon gl-alert-icon-no-title'
)
%button
.js-close.gl-alert-dismiss
{
type:
'button'
,
'aria-label'
=>
_
(
'Dismiss'
)
}
=
sprite_icon
(
'close'
,
css_class:
'gl-icon'
)
...
...
ee/spec/features/billings/billing_plans_spec.rb
View file @
a79f58bc
...
...
@@ -19,6 +19,7 @@ RSpec.describe 'Billing plan pages', :feature do
end
before
do
stub_feature_flags
(
show_billing_eoa_banner:
true
)
stub_feature_flags
(
hide_deprecated_billing_plans:
false
)
stub_experiment_for_subject
(
contact_sales_btn_in_app:
true
)
stub_full_request
(
"
#{
EE
::
SUBSCRIPTIONS_URL
}
/gitlab_plans?plan=
#{
plan
.
name
}
&namespace_id=
#{
namespace
.
id
}
"
)
...
...
@@ -35,6 +36,16 @@ RSpec.describe 'Billing plan pages', :feature do
end
end
shared_examples
'does not display EoA banner'
do
it
'does not display the banner'
,
:js
do
travel_to
(
Date
.
parse
(
EE
::
UserCalloutsHelper
::
EOA_BRONZE_PLAN_END_DATE
)
-
1
.
day
)
do
visit
page_path
expect
(
page
).
not_to
have_content
(
"End of availability for the Bronze Plan"
)
end
end
end
shared_examples
'upgradable plan'
do
before
do
visit
page_path
...
...
@@ -180,6 +191,22 @@ RSpec.describe 'Billing plan pages', :feature do
create
(
:gitlab_subscription
,
namespace:
namespace
,
hosted_plan:
plan
,
seats:
15
)
end
it
'shows the EoA bronze banner that can be dismissed permanently'
,
:js
do
travel_to
(
Date
.
parse
(
EE
::
UserCalloutsHelper
::
EOA_BRONZE_PLAN_END_DATE
)
-
1
.
day
)
do
visit
page_path
page
.
within
(
".js-eoa-bronze-plan-banner"
)
do
expect
(
page
).
to
have_content
(
"End of availability for the Bronze Plan"
)
click_button
"Dismiss"
end
visit
page_path
expect
(
page
).
not_to
have_content
(
"End of availability for the Bronze Plan"
)
end
end
it_behaves_like
'plan with header'
it_behaves_like
'downgradable plan'
it_behaves_like
'upgradable plan'
...
...
@@ -199,6 +226,7 @@ RSpec.describe 'Billing plan pages', :feature do
it_behaves_like
'upgradable plan'
it_behaves_like
'can contact sales'
it_behaves_like
'plan with subscription table'
it_behaves_like
'does not display EoA banner'
end
context
'on ultimate plan'
do
...
...
@@ -212,6 +240,7 @@ RSpec.describe 'Billing plan pages', :feature do
it_behaves_like
'downgradable plan'
it_behaves_like
'non-upgradable plan'
it_behaves_like
'plan with subscription table'
it_behaves_like
'does not display EoA banner'
end
end
...
...
ee/spec/views/shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb
View file @
a79f58bc
...
...
@@ -111,6 +111,10 @@ RSpec.describe 'shared/billings/_eoa_bronze_plan_banner.html.haml' do
it_behaves_like
'with a different plan than Bronze'
do
let
(
:namespace
)
{
group
}
end
it_behaves_like
'when user dismissed the banner'
do
let
(
:namespace
)
{
group
}
end
end
context
'with personal namespace'
do
...
...
@@ -136,5 +140,9 @@ RSpec.describe 'shared/billings/_eoa_bronze_plan_banner.html.haml' do
it_behaves_like
'with a different plan than Bronze'
do
let
(
:namespace
)
{
current_user
.
namespace
}
end
it_behaves_like
'when user dismissed the banner'
do
let
(
:namespace
)
{
current_user
.
namespace
}
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment