Skip to content

Commit 8602e6c

Browse files
committed
add failing test
1 parent f2dbf54 commit 8602e6c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packages/qwik/src/core/tests/component.spec.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,5 +2802,34 @@ describe.each([
28022802
</Component>
28032803
);
28042804
});
2805+
2806+
it('#7531 - should correctly materialize vnodes with keys including special characters', async () => {
2807+
const ChildComp = component$(() => {
2808+
return <></>;
2809+
});
2810+
2811+
const Cmp = component$(() => {
2812+
const toggle = useSignal(true);
2813+
2814+
const places = ['Beaupré, Canada'];
2815+
return (
2816+
<div>
2817+
<button
2818+
onClick$={() => {
2819+
toggle.value = !toggle.value;
2820+
}}
2821+
>
2822+
click
2823+
</button>
2824+
{toggle.value &&
2825+
places.map((place) => <ChildComp key={`trip-teaser-${place}`}></ChildComp>)}
2826+
</div>
2827+
);
2828+
});
2829+
2830+
const { document } = await render(<Cmp />, { debug });
2831+
2832+
await trigger(document.body, 'button', 'click');
2833+
});
28052834
});
28062835
});

0 commit comments

Comments
 (0)