Skip to content

Commit 9b2caa8

Browse files
vpremamozillagroovecoder
authored andcommitted
MPP-4236 - fix(announcement): suppress megabundle announcment for relay phone users
1 parent b20c102 commit 9b2caa8

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

frontend/src/components/layout/navigation/whatsnew/WhatsNewMenu.test.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ const l10nMock = {
2525
),
2626
};
2727

28+
const mockedRuntimeDataWithNoBundle = {
29+
...mockedRuntimeData,
30+
BUNDLE_PLANS: {
31+
...mockedRuntimeData.BUNDLE_PLANS,
32+
available_in_country: false,
33+
},
34+
};
35+
2836
beforeAll(() => {
2937
class MockIntersectionObserver implements IntersectionObserver {
3038
readonly root: Element | null = null;
@@ -61,7 +69,7 @@ describe("WhatsNewMenu", () => {
6169
render(
6270
<WhatsNewMenu
6371
profile={mockedProfiles.full}
64-
runtimeData={mockedRuntimeData}
72+
runtimeData={mockedRuntimeDataWithNoBundle}
6573
style="test-style"
6674
/>,
6775
);
@@ -80,7 +88,7 @@ describe("WhatsNewMenu", () => {
8088
render(
8189
<WhatsNewMenu
8290
profile={mockedProfiles.full}
83-
runtimeData={mockedRuntimeData}
91+
runtimeData={mockedRuntimeDataWithNoBundle}
8492
style="test-style"
8593
/>,
8694
);
@@ -97,7 +105,7 @@ describe("WhatsNewMenu", () => {
97105
render(
98106
<WhatsNewMenu
99107
profile={mockedProfiles.full}
100-
runtimeData={mockedRuntimeData}
108+
runtimeData={mockedRuntimeDataWithNoBundle}
101109
style="test-style"
102110
/>,
103111
);

frontend/src/components/layout/navigation/whatsnew/WhatsNewMenu.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,10 @@ export const WhatsNewMenu = (props: Props) => {
648648
`whatsnew-megabundle_${props.profile.id}`,
649649
);
650650

651-
if (isMegabundleAvailableInCountry(props.runtimeData)) {
651+
if (
652+
isMegabundleAvailableInCountry(props.runtimeData) &&
653+
!isBundleAvailableInCountry(props.runtimeData)
654+
) {
652655
const isPremium = isPeriodicalPremiumAvailableInCountry(props.runtimeData);
653656

654657
const snippet = l10n.getString(

0 commit comments

Comments
 (0)