release: WRNexusJS 0.5.10
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { normalizeComponentName } from "../src/runtime.ts";
|
||||
|
||||
test("component lookup treats PascalCase, kebab-case, and snake_case as equivalent", () => {
|
||||
expect(normalizeComponentName("PublicHeader")).toBe("publicheader");
|
||||
expect(normalizeComponentName("public-header")).toBe("publicheader");
|
||||
expect(normalizeComponentName("public_header")).toBe("publicheader");
|
||||
});
|
||||
|
||||
test("component lookup preserves meaningful alphanumeric differences", () => {
|
||||
expect(normalizeComponentName("Card2")).not.toBe(normalizeComponentName("Card"));
|
||||
expect(normalizeComponentName("PublicFooter")).not.toBe(normalizeComponentName("PublicHeader"));
|
||||
});
|
||||
@@ -49,6 +49,19 @@ test("forward auth preserves intentional verifier redirects", () => {
|
||||
expect(denied.headers.has("location")).toBe(false);
|
||||
});
|
||||
|
||||
test("forward auth exposes the verifier public origin instead of its internal app port", () => {
|
||||
const redirected = forwardAuthFailure(
|
||||
new Response(null, {
|
||||
status: 302,
|
||||
headers: { location: "/sign-in?returnTo=%2Fadmin" },
|
||||
}),
|
||||
"http://127.0.0.1:85/api/verify",
|
||||
"http://sso.localhost",
|
||||
);
|
||||
|
||||
expect(redirected.headers.get("location")).toBe("http://sso.localhost/sign-in?returnTo=%2Fadmin");
|
||||
});
|
||||
|
||||
test("gateway reads and strips internal app diagnostics", async () => {
|
||||
const response = new Response("safe public error", {
|
||||
status: 500,
|
||||
|
||||
@@ -65,3 +65,11 @@ test("collectScripts automatically adds a referenced package runtime once", () =
|
||||
),
|
||||
).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("collectScripts omits client navigation in document mode", () => {
|
||||
const scripts = collectScripts("<main>Server rendered</main>", [], {
|
||||
mode: "document",
|
||||
});
|
||||
|
||||
expect(scripts).not.toContain("/__wrnexus/nav.js");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user