File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
frontend/src/components/layout/navigation/whatsnew Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ const l10nMock = {
25
25
) ,
26
26
} ;
27
27
28
+ const mockedRuntimeDataWithNoBundle = {
29
+ ...mockedRuntimeData ,
30
+ BUNDLE_PLANS : {
31
+ ...mockedRuntimeData . BUNDLE_PLANS ,
32
+ available_in_country : false ,
33
+ } ,
34
+ } ;
35
+
28
36
beforeAll ( ( ) => {
29
37
class MockIntersectionObserver implements IntersectionObserver {
30
38
readonly root : Element | null = null ;
@@ -61,7 +69,7 @@ describe("WhatsNewMenu", () => {
61
69
render (
62
70
< WhatsNewMenu
63
71
profile = { mockedProfiles . full }
64
- runtimeData = { mockedRuntimeData }
72
+ runtimeData = { mockedRuntimeDataWithNoBundle }
65
73
style = "test-style"
66
74
/> ,
67
75
) ;
@@ -80,7 +88,7 @@ describe("WhatsNewMenu", () => {
80
88
render (
81
89
< WhatsNewMenu
82
90
profile = { mockedProfiles . full }
83
- runtimeData = { mockedRuntimeData }
91
+ runtimeData = { mockedRuntimeDataWithNoBundle }
84
92
style = "test-style"
85
93
/> ,
86
94
) ;
@@ -97,7 +105,7 @@ describe("WhatsNewMenu", () => {
97
105
render (
98
106
< WhatsNewMenu
99
107
profile = { mockedProfiles . full }
100
- runtimeData = { mockedRuntimeData }
108
+ runtimeData = { mockedRuntimeDataWithNoBundle }
101
109
style = "test-style"
102
110
/> ,
103
111
) ;
Original file line number Diff line number Diff line change @@ -648,7 +648,10 @@ export const WhatsNewMenu = (props: Props) => {
648
648
`whatsnew-megabundle_${ props . profile . id } ` ,
649
649
) ;
650
650
651
- if ( isMegabundleAvailableInCountry ( props . runtimeData ) ) {
651
+ if (
652
+ isMegabundleAvailableInCountry ( props . runtimeData ) &&
653
+ ! isBundleAvailableInCountry ( props . runtimeData )
654
+ ) {
652
655
const isPremium = isPeriodicalPremiumAvailableInCountry ( props . runtimeData ) ;
653
656
654
657
const snippet = l10n . getString (
You can’t perform that action at this time.
0 commit comments