Skip to content

Commit

Permalink
fix: typo in BFF feature flag key via enterpriseFeatures (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored Dec 18, 2024
1 parent 71e99a3 commit 619db53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/app/data/hooks/useBFF.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down Expand Up @@ -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' };
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/data/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface EnterpriseCustomer {
}

export interface EnterpriseFeatures {
enterpriseLearnerBFFEnabled: boolean;
enterpriseLearnerBffEnabled: boolean;
[key: string]: boolean;
}

Expand Down

0 comments on commit 619db53

Please sign in to comment.