Skip to content

Commit

Permalink
💚 VRTを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
arrow2nd committed Nov 3, 2024
1 parent 07a1050 commit fd56a5d
Showing 1 changed file with 21 additions and 63 deletions.
84 changes: 21 additions & 63 deletions tests/vrt/poem-card.spec.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,35 @@
import { Poem } from "types/poem";
import { expect, test } from "../fixtures";
import { getWaveMask } from "./mask";

const poems: Poem[] = [
const poems = [
// 句点で改行
{
id: "ShinySummer_SakuragiMano",
idolName: "櫻木真乃",
clothesTitle: "シャイニーサマー",
clothesName: "シャイニーサマー",
text: "1stシーズンの水着。めぐるちゃんとお揃い柄♪"
},
"ShinySummer_SakuragiMano",
// 最初の句点で改行
{
id: "One_Day_Officer",
idolName: "櫻木真乃",
clothesTitle: "ワンデイシリーズ",
clothesName: "ワンデイオフィサー",
text: "勤務回想録。敬礼。みなさんの元へ急行しますっ"
},
"One_Day_Officer",
// "!"で改行
{
id: "DressUpParfum_SakuragiMano",
idolName: "櫻木真乃",
clothesTitle: "ドレスアップパルファム",
clothesName: "ドレスアップパルファム",
text: "Cheers! 泡沫の間の輝き"
},
"DressUpParfum_SakuragiMano",
// "!"で改行
{
id: "FashionableSummer_SakuragiMano",
idolName: "櫻木真乃",
clothesTitle: "ファッショナブルサマー",
clothesName: "ファッショナブルサマー",
text: "サマーダイブ!とうめいな空と海で遊ぶ"
},
"FashionableSummer_SakuragiMano",
// 改行なし
{
id: "BaitwudeiRestaurant_SakuragiMano",
idolName: "櫻木真乃",
clothesTitle: "バイトゥデイレストラント",
clothesName: "バイトゥデイレストラント",
text: "いらっしゃいませ、輝ける場所へ"
}
"BaitwudeiRestaurant_SakuragiMano"
];

test("カードのレイアウトが変化していない @desktop", async ({ shinyPoems }) => {
const { page } = shinyPoems;
for (const poem of poems) {
test(`カードのレイアウトが変化していない (${poem}) @desktop`, async ({
shinyPoems
}) => {
const { page } = shinyPoems;

// 検索結果を上書き
await page.route("/", async (route, req) => {
if (req.method() !== "POST") {
return route.continue();
}
await page.goto(`/?id=${poem}`);

const response = await route.fetch();
const body = `0:["$@1",["development",null]]
1:{"poems":${JSON.stringify(poems)}}
`;
await shinyPoems.page
.getByTestId("poem-card-text")
.first()
.waitFor({ state: "visible" });

return route.fulfill({ response, body });
await expect(page).toHaveScreenshot({
fullPage: true,
mask: getWaveMask(page)
});
});

await page.goto("/");
await shinyPoems.searchByQuery("test");

await shinyPoems.page
.getByTestId("poem-card-text")
.first()
.waitFor({ state: "visible" });

await expect(page).toHaveScreenshot({
fullPage: true,
mask: getWaveMask(page)
});
});
}

0 comments on commit fd56a5d

Please sign in to comment.