Skip to content

Commit b9764a2

Browse files
committed
MPP-4282: (bugfix) removed hardcoded domains in prod
1 parent 2287d1a commit b9764a2

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

frontend/src/apiMocks/mockData.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ export const mockIds = ["demo", "empty", "onboarding", "some", "full"] as const;
1010

1111
// This is the same for all mock users, at this time:
1212
export const mockedRuntimeData: RuntimeData = {
13-
FXA_ORIGIN: "https://fxa-mock.com",
14-
BASKET_ORIGIN: "https://basket-mock.com",
13+
// not sure if this is the mock url we want to use
14+
FXA_ORIGIN: "http://localhost/mock/fxa",
15+
BASKET_ORIGIN: "http://localhost/mock/basket",
1516
GOOGLE_ANALYTICS_ID: "UA-123456789-0",
1617
GA4_MEASUREMENT_ID: "G-YXT33S87LT",
1718
PERIODICAL_PREMIUM_PRODUCT_ID: "prod_123456789",

frontend/src/components/phones/onboarding/RelayNumberPicker.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { RelayNumberPicker } from "../onboarding/RelayNumberPicker";
33
import { OverlayProvider } from "react-aria";
44
import { useL10n } from "../../../hooks/l10n";
55
import * as relayNumberHooks from "../../../hooks/api/relayNumber";
6+
import { formatPhone } from "../../../functions/formatPhone";
67

78
jest.mock("../../../hooks/l10n", () => ({
89
useL10n: jest.fn(),
@@ -165,7 +166,8 @@ describe("RelayNumberPicker", () => {
165166
expect(relayNumberHooks.search).toHaveBeenCalledWith("999");
166167
});
167168

168-
const label = screen.getByLabelText("(999) 888 - 7777");
169+
const formatted = formatPhone("+19998887777");
170+
const label = await screen.findByLabelText(formatted);
169171
expect(label).toBeInTheDocument();
170172
});
171173

frontend/src/functions/getPlan.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe("Megabundle Tests", () => {
158158
);
159159

160160
const expectedLink =
161-
"https://fxa-mock.com/subscriptions/products/prod_123456789?plan=price_1RMAopKb9q6OnNsLSGe1vLtt";
161+
"http://localhost/mock/fxa/subscriptions/products/prod_123456789?plan=price_1RMAopKb9q6OnNsLSGe1vLtt";
162162

163163
expect(link).toBe(expectedLink);
164164
});

frontend/src/pages/_app.page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import ReactGa from "react-ga";
99
import { getL10n } from "../functions/getL10n";
1010
import { AddonDataContext, useAddonElementWatcher } from "../hooks/addon";
1111
import { ReactAriaI18nProvider } from "../components/ReactAriaI18nProvider";
12-
import { initialiseApiMocks } from "../apiMocks/initialise";
13-
import { mockIds } from "../apiMocks/mockData";
1412
import { useIsLoggedIn } from "../hooks/session";
1513
import { useMetrics } from "../hooks/metrics";
1614
import {
@@ -60,6 +58,9 @@ function MyApp({ Component, pageProps }: AppProps) {
6058
return;
6159
}
6260
(async () => {
61+
const { initialiseApiMocks } = await import("../apiMocks/initialise");
62+
const { mockIds } = await import("../apiMocks/mockData");
63+
6364
await initialiseApiMocks();
6465

6566
if (

0 commit comments

Comments
 (0)