Create your Link in Bio for Bluesky

e2e修正

+16 -22
+15 -20
e2e/edit-redirect.spec.ts
··· 2 2 3 3 import { resetStorageState } from "./utils"; 4 4 5 - const DUMMY_EXPIRED_USER = JSON.stringify({ 6 - profile: {}, 7 - session: { 8 - accessJwt: "expired", 9 - refreshJwt: "expired", 10 - handle: "alice.test", 11 - did: "did:plc:prh5i45qtb3sck6suspbccon", 12 - email: "alice@test.com", 13 - emailConfirmed: false, 14 - active: true, 15 - }, 16 - service: "http://localhost:2583/", 17 - }); 18 - 19 5 resetStorageState(); 20 6 21 7 test.describe("編集(リダイレクト)", () => { 22 8 test("非ログイン時はトップにリダイレクト", async ({ page }) => { 23 9 await page.goto("/edit"); 24 - await page.waitForURL((url) => url.pathname === "/"); 10 + await page.waitForURL((url) => url.pathname === "/login"); 25 11 await page.waitForTimeout(2000); 26 12 }); 27 - test("ログインが無効な時はトップにリダイレクト", async ({ page }) => { 13 + test("ログインが無効な時はトップにリダイレクト", async ({ 14 + page, 15 + context, 16 + }) => { 28 17 await page.goto("/"); 29 - await page.evaluate((user) => { 30 - localStorage.setItem("user", user); 31 - }, DUMMY_EXPIRED_USER); 18 + await context.addCookies([ 19 + { 20 + name: "__session", 21 + value: 22 + "eyJkaWQiOiJkaWQ6cGxjOnRpd2h6NWdiZTVqZGt2cmdjbHB1Z2oybCJ9.09GaE2lRKbto%2FraoDdda4pGnsQNvsIRfuBHErKE1qU", 23 + domain: "linkat.localhost", 24 + path: "/", 25 + }, 26 + ]); 32 27 await page.goto("/edit"); 33 - await page.waitForURL((url) => url.pathname === "/"); 28 + await page.waitForURL((url) => url.pathname === "/login"); 34 29 await page.waitForTimeout(2000); 35 30 }); 36 31 });
+1 -2
e2e/edit.spec.ts
··· 15 15 const card1Edited = page.locator('[data-testid="sortable-card"]', { 16 16 hasText: text1Edited, 17 17 }); 18 - await page.goto("/"); 19 - await page.getByTestId("index__edit-link").click(); 18 + await page.goto("/edit"); 20 19 21 20 // カードを追加 22 21 await page.getByTestId("card-form-modal__button").click();