-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}); | ||
}); | ||
} |