release: WRNexusJS 0.2.35

This commit is contained in:
2026-07-15 08:19:54 +05:30
parent cade812569
commit 2c6e6f6de3
55 changed files with 141 additions and 86 deletions
+36
View File
@@ -610,3 +610,39 @@ function extractBehavior(output: string): {
return JSON.parse(Buffer.from(match![1], "base64").toString("utf8"));
}
test("component interpolated class attributes remain reactive", () => {
const output = generate(
parse(`
component CookieToggle {
state personalizationCookies = false
view {
<span
class="base {personalizationCookies ? 'enabled' : 'disabled'}"
>
Cookie
</span>
}
}
`),
);
const match = output.match(/data-wrn-bind-class="([^"]+)"/);
expect(match).not.toBeNull();
const encodedBinding = match?.[1] ?? "";
const decodedBinding = encodedBinding
.replaceAll("&quot;", '"')
.replaceAll("&#39;", "'")
.replaceAll("&amp;", "&")
.replaceAll("&lt;", "<")
.replaceAll("&gt;", ">");
const binding = JSON.parse(decodedBinding) as [string, string];
expect(binding[0]).toBe("class");
expect(binding[1]).toBe("base {personalizationCookies ? 'enabled' : 'disabled'}");
});