Commit 8b215f30 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '288804-clean-up-feature-flag' into 'master'

Clean up saas_manual_renew_button feature flag

See merge request gitlab-org/gitlab!52652
parents 3fd2e47c 907dc8ba
......@@ -53,7 +53,7 @@ export default {
return this.glFeatures.saasAddSeatsButton && !this.isFreePlan;
},
canRenew() {
return this.glFeatures.saasManualRenewButton && !this.isFreePlan;
return !this.isFreePlan;
},
canUpgrade() {
return this.isFreePlan || this.plan.upgradable;
......
......@@ -5,7 +5,6 @@ class Groups::BillingsController < Groups::ApplicationController
before_action :verify_namespace_plan_check_enabled
before_action only: [:index] do
push_frontend_feature_flag(:saas_manual_renew_button)
push_frontend_feature_flag(:saas_add_seats_button)
end
......
---
title: Add manual renew button to billings page
merge_request: 52652
author:
type: other
---
name: saas_manual_renew_button
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48610
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/288804
milestone: '13.7'
type: development
group: group::fulfillment
default_enabled: false
......@@ -78,7 +78,6 @@ RSpec.describe 'Groups > Billing', :js do
context 'with disabled feature flags' do
before do
stub_feature_flags(saas_manual_renew_button: false)
stub_feature_flags(saas_add_seats_button: false)
visit group_billings_path(group)
end
......@@ -86,7 +85,6 @@ RSpec.describe 'Groups > Billing', :js do
it 'does not show "Add Seats" button' do
within subscription_table do
expect(page).not_to have_link("Add seats")
expect(page).not_to have_link("Renew")
end
end
end
......@@ -111,13 +109,10 @@ RSpec.describe 'Groups > Billing', :js do
end
context 'with feature flags' do
using RSpec::Parameterized::TableSyntax
where(:saas_manual_renew_button, :saas_add_seats_button) do
true | true
true | false
false | true
false | false
where(:saas_add_seats_button) do
[
true, false
]
end
let(:plan) { 'bronze' }
......@@ -128,7 +123,6 @@ RSpec.describe 'Groups > Billing', :js do
with_them do
before do
stub_feature_flags(saas_manual_renew_button: saas_manual_renew_button)
stub_feature_flags(saas_add_seats_button: saas_add_seats_button)
end
......@@ -136,8 +130,7 @@ RSpec.describe 'Groups > Billing', :js do
visit group_billings_path(group)
expect(page).to have_pushed_frontend_feature_flags(
saasAddSeatsButton: saas_add_seats_button,
saasManualRenewButton: saas_manual_renew_button
saasAddSeatsButton: saas_add_seats_button
)
end
end
......
......@@ -19,7 +19,7 @@ describe('SubscriptionTable component', () => {
let store;
let wrapper;
const defaultFlags = { saasManualRenewButton: false, saasAddSeatsButton: false };
const defaultFlags = { saasAddSeatsButton: false };
const findAddSeatsButton = () => wrapper.findByTestId('add-seats-button');
const findManageButton = () => wrapper.findByTestId('manage-button');
......@@ -143,19 +143,15 @@ describe('SubscriptionTable component', () => {
describe('Renew button', () => {
describe.each`
planCode | featureFlag | expected | testDescription
${'silver'} | ${true} | ${true} | ${'renders the button'}
${'silver'} | ${false} | ${false} | ${'does not render the button'}
${null} | ${true} | ${false} | ${'does not render the button'}
${null} | ${false} | ${false} | ${'does not render the button'}
${'free'} | ${true} | ${false} | ${'does not render the button'}
${'free'} | ${false} | ${false} | ${'does not render the button'}
planCode | expected | testDescription
${'silver'} | ${true} | ${'renders the button'}
${null} | ${false} | ${'does not render the button'}
${'free'} | ${false} | ${'does not render the button'}
`(
'given a plan with state: planCode = $planCode and saasManualRenewButton = $featureFlag',
({ planCode, featureFlag, expected, testDescription }) => {
'given a plan with state: planCode = $planCode',
({ planCode, expected, testDescription }) => {
beforeEach(() => {
createComponentWithStore({
featureFlags: { saasManualRenewButton: featureFlag },
state: {
isLoadingSubscription: false,
plan: {
......
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