Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Jan 2, 2024
1 parent b88085a commit 8a2fa6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const KubernetesPlanContainer = (
onAdd,
onSelect,
plans,
regionAvailabilities,
selectedId,
selectedRegionId,
updatePlanCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,19 @@ describe('getPlanSoldOutStatus', () => {
expect(result).toBe(false);
});

it('should return false if plan or selectedRegionId is falsy', () => {
it('should return false if no matching regionAvailability is found (based on planId)', () => {
const result = getPlanSoldOutStatus({
plan: mockPlan,
regionAvailabilities: [
{ available: true, plan: 'fakeplan', region: 'us-east-1' },
],
selectedRegionId: mockSelectedRegionId,
});

expect(result).toBe(false);
});

it('should return false if selectedRegionId is falsy', () => {
const result = getPlanSoldOutStatus({
plan: mockPlan,
regionAvailabilities: [
Expand Down

0 comments on commit 8a2fa6e

Please sign in to comment.