feat: add dedicated home page and automatic dark mode
Reference site / build (push) Canceled after 0s

This commit is contained in:
2026-10-16 00:52:01 +09:00
parent 839eb2a6a4
commit b7cef01afd
15 changed files with 866 additions and 70 deletions
+6 -2
View File
@@ -5,7 +5,11 @@ test('home and book share the usable tree without client JavaScript', async ({ p
const failures: string[] = [];
page.on('response', (response) => { if (response.status() >= 400) failures.push(response.url()); });
await page.goto('./');
await expect(page.locator('[data-selected-content] h1')).toHaveText('1. コンセプト');
await expect(page.locator('.selected-content.prose[data-selected-content] .root-page[data-root-page]').getByRole('heading', { level: 1, name: 'WIP', exact: true })).toBeVisible();
await expect(page.locator('[data-landing-stage]')).toHaveAttribute('data-current-path', '/');
await expect(page.locator('.root-mark')).toHaveAttribute('aria-current', 'page');
await expect(page.locator('.root-mark')).toHaveAttribute('aria-selected', 'true');
await expect(page.locator('[data-selected-content]')).not.toContainText('1. コンセプト');
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true);
await expect(page.locator('.branch-prefix').first()).toHaveAttribute('data-prefix', '└─ ');
const root = await page.locator('.root-mark').boundingBox();
@@ -19,7 +23,7 @@ test('home and book share the usable tree without client JavaScript', async ({ p
expect(Math.abs(footX - spine.x)).toBeLessThan(1);
expect(Math.abs(root!.y + root!.height - spine.y)).toBeLessThan(1);
await page.screenshot({ path: testInfo.outputPath('home.png'), fullPage: true });
await page.getByRole('link', { name: 'Book', exact: true }).click();
await page.getByRole('navigation', { name: 'ルートページのナビゲーション', exact: true }).getByRole('link', { name: /^Book(?:\s|$)/ }).click();
await expect(page).toHaveURL(new URL('book/', testInfo.project.use.baseURL!).href);
await expect(page.locator('[data-landing-stage]')).toHaveAttribute('data-current-path', '/book');
await expect(page.locator('.demo-node')).toHaveCount(treeNodeCount);