File tree 3 files changed +38
-0
lines changed
components/mma/accountoverview
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
28
28
supporterPlusAnnualCancelled ,
29
29
supporterPlusCancelled ,
30
30
supporterPlusInOfferPeriod ,
31
+ supporterPlusUSA ,
31
32
tierThree ,
32
33
} from '../../../fixtures/productBuilder/testProducts' ;
33
34
import { singleContributionsAPIResponse } from '../../../fixtures/singleContribution' ;
@@ -104,6 +105,31 @@ export const WithSubscriptions: StoryObj<typeof AccountOverview> = {
104
105
} ,
105
106
} ;
106
107
108
+ export const WithUSASubscription : StoryObj < typeof AccountOverview > = {
109
+ render : ( ) => {
110
+ return < AccountOverview /> ;
111
+ } ,
112
+
113
+ parameters : {
114
+ msw : [
115
+ http . get ( '/api/cancelled/' , ( ) => {
116
+ return HttpResponse . json ( [ ] ) ;
117
+ } ) ,
118
+ http . get ( '/mpapi/user/mobile-subscriptions' , ( ) => {
119
+ return HttpResponse . json ( { subscriptions : [ ] } ) ;
120
+ } ) ,
121
+ http . get ( '/api/me/mma' , ( ) => {
122
+ return HttpResponse . json (
123
+ toMembersDataApiResponse ( supporterPlusUSA ( ) ) ,
124
+ ) ;
125
+ } ) ,
126
+ http . get ( '/api/me/one-off-contributions' , ( ) => {
127
+ return HttpResponse . json ( [ ] ) ;
128
+ } ) ,
129
+ ] ,
130
+ } ,
131
+ } ;
132
+
107
133
export const WithContributionAndSwitchPossible : StoryObj <
108
134
typeof AccountOverview
109
135
> = {
Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ export class ProductBuilder {
137
137
return this ;
138
138
}
139
139
140
+ inUSA ( ) {
141
+ this . productToBuild . billingCountry = 'United States' ;
142
+ return this ;
143
+ }
144
+
140
145
nonServiceableCountry ( ) {
141
146
this . productToBuild . billingCountry = 'Qatar' ;
142
147
return this ;
Original file line number Diff line number Diff line change @@ -212,6 +212,13 @@ export function supporterPlus() {
212
212
. getProductDetailObject ( ) ;
213
213
}
214
214
215
+ export function supporterPlusUSA ( ) {
216
+ return new ProductBuilder ( baseSupporterPlus ( ) )
217
+ . payByCard ( )
218
+ . inUSA ( )
219
+ . getProductDetailObject ( ) ;
220
+ }
221
+
215
222
export function supporterPlusMonthlyAllAccessDigital ( ) {
216
223
return new ProductBuilder ( baseSupporterPlus ( ) )
217
224
. payByCard ( )
You can’t perform that action at this time.
0 commit comments