Skip to content

Commit 0832e09

Browse files
committed
fix: account for mobile my account links
1 parent 395b304 commit 0832e09

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

tests/donations.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from "@playwright/test";
2-
import { randomEmailAddress } from "./utils";
2+
import { clickMyAccountMenuItem, randomEmailAddress } from "./utils";
33

44
const getPageInIframe = (page) =>
55
page.frameLocator('iframe[name="newspack_modal_checkout_iframe"]');
@@ -61,8 +61,7 @@ test("Donations", {
6161
await expect(page.locator("#newspack_account_email")).toHaveValue(
6262
emailAddress
6363
);
64-
await page.getByRole("link", { name: "My Subscription" }).click();
65-
64+
await clickMyAccountMenuItem(page, "Subscription");
6665
await expect(page.getByText("Visa card ending in 4242")).toBeVisible();
6766
await expect(
6867
page.getByRole("cell", { name: "$15.00 / month" }).first()

tests/reader-registration.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ test("Register on the site", {
5959
* Now the user is authenticated via the magic link, they can update their name.
6060
*/
6161
await page.getByRole("link", { name: "My Account" }).click();
62-
await clickMyAccountMenuItem(page, "Account settings");
6362
await page.getByPlaceholder("Your First Name").click();
6463
await page.getByPlaceholder("Your First Name").fill("John");
6564
await page.getByPlaceholder("Your Last Name").click();
@@ -119,7 +118,6 @@ test("Register on the site", {
119118
* Reader updates their email address.
120119
*/
121120
const newEmailAddress = randomEmailAddress();
122-
await clickMyAccountMenuItem(page, "Account settings");
123121
await page.locator("#newspack_account_email").fill(newEmailAddress);
124122
await page.getByRole("button", { name: "Update profile" }).click();
125123
const expectedNotification = `A verification email has been sent to ${newEmailAddress}. Please verify to complete the change.`;

0 commit comments

Comments
 (0)