fix tests

This commit is contained in:
superdinmc
2025-10-28 13:10:40 +07:00 Unverified
parent b3c8157886
commit be725bcd40
6 changed files with 61 additions and 22 deletions
+2 -1
View File
@@ -365,6 +365,7 @@ export function TierList({
className="absolute top-0 right-0 m-2"
size="icon"
onClick={() => showDisclaimer(false)}
aria-label="Close Disclaimer"
>
<X />
</Button>
@@ -374,7 +375,7 @@ export function TierList({
)}
<div className="flex-1 min-h-0 overflow-auto">
<div
className={`grid w-full [&>*]:border`}
className={`grid w-full *:border`}
style={{
gridTemplateColumns: `min-content repeat(${columns.length}, 1fr)`,
gridTemplateRows: `min-content repeat(${tiers.length}, minmax(0, min-content))`,
BIN
View File
Binary file not shown.
+6 -1
View File
@@ -99,6 +99,11 @@
"@types/react-dom": "19.2.2"
},
"trustedDependencies": [
"@tailwindcss/oxide"
"@prisma/client",
"@prisma/engines",
"@tailwindcss/oxide",
"esbuild",
"prisma",
"sharp"
]
}
+9 -9
View File
@@ -39,10 +39,10 @@ export default defineConfig({
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
// {
// name: "firefox",
// use: { ...devices["Desktop Firefox"] },
// },
{
name: "webkit",
@@ -50,10 +50,10 @@ export default defineConfig({
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
{
name: "Mobile Chrome",
use: { ...devices["Pixel 5"] },
},
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
@@ -72,7 +72,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: {
command: "bun run build && bun start",
command: "bun dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
+24 -5
View File
@@ -11,18 +11,37 @@ test("has title", async ({ page }) => {
test("artifact link", async ({ page }) => {
await page.goto(BASE_URL);
const viewportSize = page.viewportSize();
const isMobile = viewportSize && viewportSize.width < 768;
await page.getByText("เสือกไอดีชาวบ้าน").click();
await page
.getByText(isMobile ? "ตรวจแฟลกเกนชินรายแพทช์" : "เสือกไอดีชาวบ้าน")
.click();
await expect(page.getByAltText("เสือกไอดีชาวบ้าน")).toBeVisible();
});
test("tierlist link", async ({ page }) => {
test("tierlist public", async ({ page }) => {
await page.goto(BASE_URL);
await page.getByText("จัดเทียร์ลิสต์").click();
await page.getByText("5.7b").click();
await expect(page.getByAltText("Disclaimer")).toBeVisible();
const viewportSize = page.viewportSize();
const isMobile = viewportSize && viewportSize.width < 768;
if (isMobile) {
await expect(page.getByText("โปรดปรับจอเป็นแนวนอน")).toBeVisible({
timeout: 15000,
});
// rotate phone
await page.setViewportSize({
height: viewportSize.width,
width: viewportSize.height,
});
}
await expect(page.getByAltText("Disclaimer")).toBeVisible({ timeout: 15000 });
await page.getByRole("button", { name: "Close Disclaimer" }).click();
await expect(page.getByAltText("Disclaimer")).toBeHidden();
});
+20 -6
View File
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -19,9 +23,15 @@
}
],
"paths": {
"@/*": ["./*"],
"$/*": ["./lib/*"],
"#/*": ["./public/*"]
"@/*": [
"./*"
],
"$/*": [
"./lib/*"
],
"#/*": [
"./public/*"
]
}
},
"include": [
@@ -29,7 +39,11 @@
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
".next/dev/types/**/*.ts",
".next\\dev/types/**/*.ts",
".next\\dev/types/**/*.ts"
],
"exclude": ["node_modules"]
"exclude": [
"node_modules"
]
}