AI: address review on PR #460
このコミットが含まれているのは:
@@ -2,6 +2,7 @@ import assert from 'node:assert/strict'
|
||||
import { createServer } from 'node:http'
|
||||
import { spawn } from 'node:child_process'
|
||||
import { after, before, test } from 'node:test'
|
||||
import { JSDOM } from 'jsdom'
|
||||
import { createServer as createViteServer } from 'vite'
|
||||
|
||||
import { render } from './dist/server/entry-server.js'
|
||||
@@ -402,6 +403,26 @@ test ('every canonical screen route returns page HTML without JavaScript', async
|
||||
}
|
||||
})
|
||||
|
||||
test ('SSR HTML head includes reciprocal hreflang links with query parameters', async () => {
|
||||
for (const locale of ['ja', 'ain-Kana']) {
|
||||
const response = await fetch (`${httpOrigin}/${locale}/posts?page=2&limit=50`)
|
||||
assert.equal (response.status, 200)
|
||||
const dom = new JSDOM (await response.text ())
|
||||
try
|
||||
{
|
||||
const links = [...dom.window.document.head.querySelectorAll ('link[rel="alternate"]')]
|
||||
assert.deepEqual (links.map (link => ({
|
||||
locale: link.getAttribute ('hreflang'), href: link.getAttribute ('href') })), [
|
||||
{ locale: 'ja', href: `${origin}/ja/posts?page=2&limit=50` },
|
||||
{ locale: 'ain-Kana', href: `${origin}/ain-Kana/posts?page=2&limit=50` }])
|
||||
}
|
||||
finally
|
||||
{
|
||||
dom.window.close ()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
test ('YouTube posts return HTTP 200 with the embed rendered by SSR', async t => {
|
||||
for (const locale of ['ja', 'ain-Kana']) {
|
||||
await t.test (locale, async () => {
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする