Commit d45702d2 authored by Angelo Gulina's avatar Angelo Gulina Committed by Nicolò Maria Mezzopera

Update check for free plan with both code and null

parent 19d08365
export const isFreePlan = state => state.plan.code === null; export const isFreePlan = state => ['free', null].includes(state.plan.code);
---
title: 50275 Update check for free plan with both code and null
merge_request: 50275
author:
type: fixed
...@@ -116,6 +116,7 @@ describe('SubscriptionTable component', () => { ...@@ -116,6 +116,7 @@ describe('SubscriptionTable component', () => {
planCode | expected | testDescription planCode | expected | testDescription
${'bronze'} | ${true} | ${'renders the button'} ${'bronze'} | ${true} | ${'renders the button'}
${null} | ${false} | ${'does not render the button'} ${null} | ${false} | ${'does not render the button'}
${'free'} | ${false} | ${'does not render the button'}
`( `(
'given a plan with state: planCode = $planCode and saasAddSeatsButton = $featureFlag', 'given a plan with state: planCode = $planCode and saasAddSeatsButton = $featureFlag',
({ planCode, upgradable, expected, testDescription }) => { ({ planCode, upgradable, expected, testDescription }) => {
...@@ -145,6 +146,8 @@ describe('SubscriptionTable component', () => { ...@@ -145,6 +146,8 @@ describe('SubscriptionTable component', () => {
${'silver'} | ${false} | ${false} | ${'does not render the button'} ${'silver'} | ${false} | ${false} | ${'does not render the button'}
${null} | ${true} | ${false} | ${'does not render the button'} ${null} | ${true} | ${false} | ${'does not render the button'}
${null} | ${false} | ${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'}
`( `(
'given a plan with state: planCode = $planCode and saasManualRenewButton = $featureFlag', 'given a plan with state: planCode = $planCode and saasManualRenewButton = $featureFlag',
({ planCode, featureFlag, expected, testDescription }) => { ({ planCode, featureFlag, expected, testDescription }) => {
...@@ -174,6 +177,8 @@ describe('SubscriptionTable component', () => { ...@@ -174,6 +177,8 @@ describe('SubscriptionTable component', () => {
${'silver'} | ${false} | ${false} | ${'does not render the button'} ${'silver'} | ${false} | ${false} | ${'does not render the button'}
${null} | ${true} | ${false} | ${'does not render the button'} ${null} | ${true} | ${false} | ${'does not render the button'}
${null} | ${false} | ${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'}
`( `(
'given a plan with state: planCode = $planCode and saasAddSeatsButton = $featureFlag', 'given a plan with state: planCode = $planCode and saasAddSeatsButton = $featureFlag',
({ planCode, featureFlag, expected, testDescription }) => { ({ planCode, featureFlag, expected, testDescription }) => {
...@@ -204,6 +209,8 @@ describe('SubscriptionTable component', () => { ...@@ -204,6 +209,8 @@ describe('SubscriptionTable component', () => {
${'bronze'} | ${false} | ${false} | ${'does not render the button'} ${'bronze'} | ${false} | ${false} | ${'does not render the button'}
${null} | ${true} | ${true} | ${'renders the button'} ${null} | ${true} | ${true} | ${'renders the button'}
${null} | ${false} | ${true} | ${'renders the button'} ${null} | ${false} | ${true} | ${'renders the button'}
${'free'} | ${true} | ${true} | ${'renders the button'}
${'free'} | ${false} | ${true} | ${'renders the button'}
`( `(
'given a plan with state: planCode = $planCode, upgradable = $upgradable', 'given a plan with state: planCode = $planCode, upgradable = $upgradable',
({ planCode, upgradable, expected, testDescription }) => { ({ planCode, upgradable, expected, testDescription }) => {
......
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