mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-03-15 07:04:41 +08:00
test: unit test for #728
This commit is contained in:
parent
a6fb3c6e64
commit
a4d01377ec
@ -364,6 +364,20 @@ describe('PatchFlags', () => {
|
|||||||
expect(wrapper.html()).toBe('<div style="display: none;">NEED_PATCH</div>');
|
expect(wrapper.html()).toBe('<div style="display: none;">NEED_PATCH</div>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('#728: template literals with expressions should be treated as dynamic', async () => {
|
||||||
|
const wrapper = mount({
|
||||||
|
setup() {
|
||||||
|
const foo = ref(0);
|
||||||
|
return () => (
|
||||||
|
<button value={`${foo.value}`} onClick={() => foo.value++}></button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
patchFlagExpect(wrapper, 8, ['value', 'onClick']);
|
||||||
|
await wrapper.trigger('click');
|
||||||
|
expect(wrapper.html()).toBe('<button value="1"></button>');
|
||||||
|
})
|
||||||
|
|
||||||
test('full props', async () => {
|
test('full props', async () => {
|
||||||
const wrapper = mount({
|
const wrapper = mount({
|
||||||
setup() {
|
setup() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user