refactor: migrate legacy wire namespace to wrn
This commit is contained in:
@@ -809,7 +809,7 @@ test("component server calls send the CSRF cookie in the RPC header", async () =
|
||||
);
|
||||
Object.defineProperty(win.document, "cookie", {
|
||||
configurable: true,
|
||||
value: "wire-csrf=rpc%20token",
|
||||
value: "wrn-csrf=rpc%20token",
|
||||
});
|
||||
let request: RequestInit | undefined;
|
||||
const globals = globalThis as Record<string, unknown>;
|
||||
@@ -837,7 +837,7 @@ test("component server calls prefer the rendered CSRF token over stale cookies",
|
||||
);
|
||||
Object.defineProperty(win.document, "cookie", {
|
||||
configurable: true,
|
||||
value: "wire-csrf=stale-token",
|
||||
value: "wrn-csrf=stale-token",
|
||||
});
|
||||
let request: RequestInit | undefined;
|
||||
const globals = globalThis as Record<string, unknown>;
|
||||
@@ -902,8 +902,8 @@ test("development runtime warns when a component binding names a missing functio
|
||||
test("development runtime warns for referenced theme tokens absent from rendered CSS", () => {
|
||||
const win = new Window() as unknown as Window & Record<string, unknown>;
|
||||
win.document.head.innerHTML =
|
||||
`<style>:root { --wire-present-test: red; } .probe { ` +
|
||||
`color: var(--wire-present-test); background: var(--wire-missing-test); }</style>`;
|
||||
`<style>:root { --wrn-present-test: red; } .probe { ` +
|
||||
`color: var(--wrn-present-test); background: var(--wrn-missing-test); }</style>`;
|
||||
win.document.body.innerHTML = `<div class="probe" data-scope=""></div>`;
|
||||
(globalThis as Record<string, unknown>).window = win;
|
||||
(globalThis as Record<string, unknown>).document = win.document;
|
||||
@@ -930,15 +930,15 @@ test("development runtime warns for referenced theme tokens absent from rendered
|
||||
}
|
||||
expect(warnings).toHaveLength(1);
|
||||
expect(String(warnings[0]?.[0])).toContain("WRN-DEV-THEME-TOKEN-MISSING");
|
||||
expect(String(warnings[0]?.[0])).toContain("--wire-missing-test");
|
||||
expect(String(warnings[0]?.[0])).toContain("--wrn-missing-test");
|
||||
});
|
||||
|
||||
test("development runtime accepts component-local and inline wire variables", () => {
|
||||
test("development runtime accepts component-local and inline wrn variables", () => {
|
||||
const win = new Window() as unknown as Window & Record<string, unknown>;
|
||||
win.document.head.innerHTML =
|
||||
`<style>.component { --wire-component-local: red; color: var(--wire-component-local); ` +
|
||||
`background: var(--wire-inline-local); }</style>`;
|
||||
win.document.body.innerHTML = `<div class="component" style="--wire-inline-local: blue" data-scope=""></div>`;
|
||||
`<style>.component { --wrn-component-local: red; color: var(--wrn-component-local); ` +
|
||||
`background: var(--wrn-inline-local); }</style>`;
|
||||
win.document.body.innerHTML = `<div class="component" style="--wrn-inline-local: blue" data-scope=""></div>`;
|
||||
(globalThis as Record<string, unknown>).window = win;
|
||||
(globalThis as Record<string, unknown>).document = win.document;
|
||||
(globalThis as Record<string, unknown>).location = win.location;
|
||||
@@ -1076,9 +1076,9 @@ test("toast() falls back to the console when no toaster is mounted", () => {
|
||||
test("toast is reachable as a real global for compiled client modules", () => {
|
||||
const win = mount(`<div data-scope=""></div>`) as unknown as Window & {
|
||||
toast?: unknown;
|
||||
wireToast?: unknown;
|
||||
wrnToast?: unknown;
|
||||
};
|
||||
expect(typeof win.wireToast).toBe("function");
|
||||
expect(typeof win.wrnToast).toBe("function");
|
||||
expect(typeof win.toast).toBe("function");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user