fix: render state not unique per render (#1638)
This commit is contained in:
+9
-4
@@ -58,10 +58,15 @@ Deno.test("/props/123 page prerender", async () => {
|
||||
assertEquals(resp.status, Status.OK);
|
||||
assertEquals(resp.headers.get("content-type"), "text/html; charset=utf-8");
|
||||
const body = await resp.text();
|
||||
assertStringIncludes(
|
||||
body,
|
||||
`{"params":{"id":"123"},"url":"https://fresh.deno.dev/props/123","route":"/props/:id","state":{"root":"root_mw"}}`,
|
||||
);
|
||||
const doc = parseHtml(body);
|
||||
const data = JSON.parse(doc.querySelector("body > div").textContent);
|
||||
|
||||
assertEquals(data, {
|
||||
"params": { "id": "123" },
|
||||
"url": "https://fresh.deno.dev/props/123",
|
||||
"route": "/props/:id",
|
||||
"state": { "root": "root_mw" },
|
||||
});
|
||||
});
|
||||
|
||||
Deno.test("/greet/[name] page prerender", async () => {
|
||||
|
||||
Reference in New Issue
Block a user