Explain why each Greatest manga earned its place

This commit is contained in:
Codex committed 2026-10-09 11:26:57 +02:00
1 parent bedd0bc3b3
commit f493afcc18
3 files changed
+114 -108

No files matched your search

+4 -2
View File
@@ -4,6 +4,7 @@ const assert = require('node:assert/strict');
const fs = require('node:fs'), os = require('node:os'), path = require('node:path'), net = require('node:net');
const { spawn } = require('node:child_process');
const { chromium } = require('playwright');
const { loadCatalog } = require('../greatest');
const root = path.resolve(__dirname, '..');
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function freePort() {
@@ -47,7 +48,8 @@ async function freePort() {
assert.equal(await page.locator('.greatest-tile').count(), 106);
const astro = page.locator('.greatest-tile').filter({ has: page.getByRole('button', { name: 'Details for Astro Boy' }) });
assert.equal(await astro.locator('.greatest-reason').isVisible(), true);
assert.match(await astro.locator('.greatest-reason').textContent(), /long-form adventure manga/);
const astroReason = loadCatalog().entries.find(entry => entry.title === 'Astro Boy').note;
assert.match(await astro.locator('.greatest-reason').textContent(), /foundational postwar story manga/);
assert.equal(await astro.locator('.greatest-reason-label').textContent(), 'Why it matters');
await astro.getByRole('button', { name: 'Definitely want: Astro Boy' }).click();
await page.getByRole('button', { name: '🔥 Flame' }).click();
@@ -56,7 +58,7 @@ async function freePort() {
await page.getByRole('button', { name: 'Rank by everyone' }).click();
await page.getByRole('button', { name: 'Details for Astro Boy' }).click();
await page.getByRole('dialog').getByRole('heading', { name: 'Why it matters' }).waitFor();
assert.match(await page.getByRole('dialog').textContent(), /foundation for the Pluto branch/);
assert.ok((await page.getByRole('dialog').textContent()).includes(astroReason));
await page.getByRole('dialog').getByText('Community votes: 🔥 1').waitFor();
await page.getByRole('dialog').getByRole('button', { name: 'Close' }).click();
await page.setViewportSize({ width: 390, height: 844 });