Skip to content

Commit d4c3150

Browse files
author
Richard Bangay
committed
add USA account overview product story so that the new cancel CTA is visible
1 parent 069707b commit d4c3150

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

client/components/mma/accountoverview/AccountOverview.stories.tsx

+26
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
supporterPlusAnnualCancelled,
2929
supporterPlusCancelled,
3030
supporterPlusInOfferPeriod,
31+
supporterPlusUSA,
3132
tierThree,
3233
} from '../../../fixtures/productBuilder/testProducts';
3334
import { singleContributionsAPIResponse } from '../../../fixtures/singleContribution';
@@ -104,6 +105,31 @@ export const WithSubscriptions: StoryObj<typeof AccountOverview> = {
104105
},
105106
};
106107

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+
107133
export const WithContributionAndSwitchPossible: StoryObj<
108134
typeof AccountOverview
109135
> = {

client/fixtures/productBuilder/productBuilder.ts

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ export class ProductBuilder {
137137
return this;
138138
}
139139

140+
inUSA() {
141+
this.productToBuild.billingCountry = 'United States';
142+
return this;
143+
}
144+
140145
nonServiceableCountry() {
141146
this.productToBuild.billingCountry = 'Qatar';
142147
return this;

client/fixtures/productBuilder/testProducts.ts

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ export function supporterPlus() {
212212
.getProductDetailObject();
213213
}
214214

215+
export function supporterPlusUSA() {
216+
return new ProductBuilder(baseSupporterPlus())
217+
.payByCard()
218+
.inUSA()
219+
.getProductDetailObject();
220+
}
221+
215222
export function supporterPlusMonthlyAllAccessDigital() {
216223
return new ProductBuilder(baseSupporterPlus())
217224
.payByCard()

0 commit comments

Comments
 (0)