diff --git a/frontend/server.ssr.test.mjs b/frontend/server.ssr.test.mjs index 20d6ef2..d847913 100644 --- a/frontend/server.ssr.test.mjs +++ b/frontend/server.ssr.test.mjs @@ -332,28 +332,32 @@ after (async () => { if (errors.length) throw new AggregateError (errors, 'SSR teardown failed') }) -test ('counts SSR uses query/definitions, noindex and the common site title', async () => { +test ('counts SSR renders the shell without result requests or embedded results', async () => { for (const locale of ['ja', 'ain-Kana']) { - for (const resource of ['posts', 'tags']) { + for (const [resource, mode] of ['posts', 'tags'].flatMap (resource => + ['summary', 'details'].map (mode => [resource, mode]))) { const column = resource === 'posts' ? 'title' : (locale === 'ja' ? 'name_ja' : 'name_ain') const query = - `definition=history&mode=details&columns=resource_id+${ column }&user_id=4&timezone=UTC` + `definition=history&mode=${mode}&columns=resource_id+${ column }&user_id=4&timezone=UTC` + const start = requests.length const result = await renderPage (`/${locale}/counts/${resource}?${query}`, origin, apiURL) + const calls = requests.slice (start).map (request => new URL (request.url, origin)) assert.equal (result.status, 200) - assert.match (result.html, /SSR count/) - assert.match (result.html, new RegExp (`/${locale}/${resource}/1`)) + assert.doesNotMatch (result.html, /SSR count|counts-grid|counts-nested/) + assert.match (result.html, /counts-targets/) + assert.match (result.html, /