Files
pages/internal/server/testdata/public-periodical.js
T
Anya Tokugawa c1175d389f Implement Knowledge City platform, organizer and DAV integration
Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
2026-09-27 14:44:43 +09:00

24 lines
1.9 KiB
JavaScript

(async () => {
try {
await new Promise(resolve => setTimeout(resolve, 100));
const check = (ok, message) => { if (!ok) throw new Error(message); };
check(document.querySelector('.periodical-site-title').textContent === 'Public Blog', 'Domain branding');
check(document.querySelector('.periodical-full-article h1').textContent === 'Public registered title & notes', 'Registered title');
check(document.querySelector('.periodical-body').textContent.includes('Article body'), 'Body rendering');
check(document.querySelector('a[rel=next]').getAttribute('href') === '/2026/09/18/keyword', 'Next article');
check(document.querySelector('a[rel=prev]').getAttribute('href') === '/2026/09/16', 'Previous article');
check(document.querySelector('.periodical-calendar').getBoundingClientRect().width > 100, 'Calendar visibility');
const monthControls = document.querySelector('.periodical-month-controls');
check(monthControls && monthControls.getBoundingClientRect().height <= 36, 'Single-line month controls');
check(monthControls.getBoundingClientRect().bottom <= document.querySelector('.periodical-calendar').getBoundingClientRect().top, 'Month controls above calendar');
check(document.documentElement.scrollWidth <= innerWidth + 2, 'Horizontal overflow');
check(!document.querySelector('.periodical-body script'), 'Inert content');
const feed = await fetch('/rss.xml', {cache: 'no-store'});
const xml = new DOMParser().parseFromString(await feed.text(), 'application/xml');
check(feed.ok && !xml.querySelector('parsererror') && xml.querySelectorAll('item').length === 3, 'RSS');
document.body.dataset.vimReady = 'true';
} catch (error) {
const element = document.createElement('pre'); element.id = 'error'; element.textContent = error.stack; document.body.append(element);
}
})();