Skip to content

Commit a4d0137

Browse files
committed
test: unit test for #728
1 parent a6fb3c6 commit a4d0137

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/babel-plugin-jsx/test/index.test.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,20 @@ describe('PatchFlags', () => {
364364
expect(wrapper.html()).toBe('<div style="display: none;">NEED_PATCH</div>');
365365
});
366366

367+
test('#728: template literals with expressions should be treated as dynamic', async () => {
368+
const wrapper = mount({
369+
setup() {
370+
const foo = ref(0);
371+
return () => (
372+
<button value={`${foo.value}`} onClick={() => foo.value++}></button>
373+
);
374+
}
375+
});
376+
patchFlagExpect(wrapper, 8, ['value', 'onClick']);
377+
await wrapper.trigger('click');
378+
expect(wrapper.html()).toBe('<button value="1"></button>');
379+
})
380+
367381
test('full props', async () => {
368382
const wrapper = mount({
369383
setup() {

0 commit comments

Comments
 (0)