From 619db538c64f1c8163fcc28cc22785b445012fcd Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 18 Dec 2024 14:54:29 -0500 Subject: [PATCH] fix: typo in BFF feature flag key via enterpriseFeatures (#1242) --- src/components/app/data/hooks/useBFF.test.jsx | 4 ++-- src/components/app/data/utils.js | 2 +- src/types.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/app/data/hooks/useBFF.test.jsx b/src/components/app/data/hooks/useBFF.test.jsx index 989bc78bf..5979c0f39 100644 --- a/src/components/app/data/hooks/useBFF.test.jsx +++ b/src/components/app/data/hooks/useBFF.test.jsx @@ -138,7 +138,7 @@ describe('useBFF', () => { beforeEach(() => { jest.clearAllMocks(); useEnterpriseCustomer.mockReturnValue({ data: mockEnterpriseCustomer }); - useEnterpriseFeatures.mockReturnValue({ data: { enterpriseLearnerBFFEnabled: false } }); + useEnterpriseFeatures.mockReturnValue({ data: { enterpriseLearnerBffEnabled: false } }); fetchEnterpriseLearnerDashboard.mockResolvedValue(mockBFFDashboardData); useLocation.mockReturnValue({ pathname: '/test-enterprise' }); useParams.mockReturnValue({ enterpriseSlug: 'test-enterprise' }); @@ -207,7 +207,7 @@ describe('useBFF', () => { }); } if (isBFFEnabledForUser) { - useEnterpriseFeatures.mockReturnValue({ data: { enterpriseLearnerBFFEnabled: true } }); + useEnterpriseFeatures.mockReturnValue({ data: { enterpriseLearnerBffEnabled: true } }); } const isBFFEnabled = isBFFEnabledForCustomer || isBFFEnabledForUser; const mockFallbackData = { fallback: 'data' }; diff --git a/src/components/app/data/utils.js b/src/components/app/data/utils.js index 2da2360c5..9246382e5 100644 --- a/src/components/app/data/utils.js +++ b/src/components/app/data/utils.js @@ -913,7 +913,7 @@ export function isBFFEnabled(enterpriseCustomerUuid, enterpriseFeatures) { // 1. BFF is enabled for the enterprise customer. // 2. BFF is enabled for the request user via Waffle flag (supporting percentage-based rollout) const isBFFEnabledForCustomer = isBFFEnabledForEnterpriseCustomer(enterpriseCustomerUuid); - if (isBFFEnabledForCustomer || enterpriseFeatures?.enterpriseLearnerBFFEnabled) { + if (isBFFEnabledForCustomer || enterpriseFeatures?.enterpriseLearnerBffEnabled) { return true; } diff --git a/src/types.d.ts b/src/types.d.ts index 80f96e59f..9c0c4f9e7 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -45,7 +45,7 @@ export interface EnterpriseCustomer { } export interface EnterpriseFeatures { - enterpriseLearnerBFFEnabled: boolean; + enterpriseLearnerBffEnabled: boolean; [key: string]: boolean; }