release: WRNexusJS 0.2.49
This commit is contained in:
@@ -881,7 +881,7 @@ component Accordion {
|
||||
|
||||
expect(output).not.toContain('${(isOpen(index)) ? " open" : ""}');
|
||||
});
|
||||
test("server-rendered each locals work in reactive handlers", () => {
|
||||
test("server-rendered each locals work in reactive handlers", async () => {
|
||||
const firstLocals = Buffer.from(
|
||||
JSON.stringify({
|
||||
item: {
|
||||
@@ -903,13 +903,12 @@ test("server-rendered each locals work in reactive handlers", () => {
|
||||
).toString("base64");
|
||||
|
||||
const dom = mountHtml(`
|
||||
<div
|
||||
data-scope="openIndex: -1"
|
||||
>
|
||||
<div data-scope="openIndex: -1">
|
||||
<article
|
||||
data-wrn-loop-locals="${firstLocals}"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
data-on-click="openIndex = index"
|
||||
>
|
||||
First
|
||||
@@ -924,6 +923,7 @@ test("server-rendered each locals work in reactive handlers", () => {
|
||||
data-wrn-loop-locals="${secondLocals}"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
data-on-click="openIndex = index"
|
||||
>
|
||||
Second
|
||||
@@ -936,13 +936,15 @@ test("server-rendered each locals work in reactive handlers", () => {
|
||||
</div>
|
||||
`);
|
||||
|
||||
const buttons: any = dom.querySelectorAll("button");
|
||||
const buttons = dom.querySelectorAll("button") as HTMLButtonElement[];
|
||||
|
||||
buttons[1].click();
|
||||
buttons[1]!.click();
|
||||
|
||||
await Promise.resolve();
|
||||
|
||||
const articles = dom.querySelectorAll("article");
|
||||
|
||||
expect(articles[0].querySelector("span")?.classList.contains("open")).toBe(false);
|
||||
expect(articles[0]!.querySelector("span")?.classList.contains("open")).toBe(false);
|
||||
|
||||
expect(articles[1].querySelector("span")?.classList.contains("open")).toBe(true);
|
||||
expect(articles[1]!.querySelector("span")?.classList.contains("open")).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user