Infinite loop QFab/QFabAction in unit test
See original GitHub issueDescribe the bug I been upgrading Quasar in my project. Here are the versions: @quasar/app: 1.5.5 > 1.8.6 quasar: 1.9.1 > 1.11.3
The project still runs so that is not the issue. Some of my unit tests are suddenly broken now, and are reporting:
[Vue warn]: You may have an infinite update loop in a component render function.
found in
---> <QFab>
<Container>
<Root>
Since nothing changed in my code and I still use the same Jest version, the only thing I can think of here is that this is a Quasar related issue.
Codepen/jsFiddle/Codesandbox (required) Fork a Codepen (https://codepen.quasar.dev) or a jsFiddle (https://jsfiddle.quasar.dev) or a Codesandbox (https://codesandbox.quasar.dev) and hit save then copy-paste link here.
To Reproduce I’m testing the following component:
<template>
<q-fab-action color="info" icon="save" :disable="isDisabled" @click="onClick" class="someName" />
</template>
The test is quite simple, I mount the component and change the computed “isDisabled” property in the test and then assert if the HTML rendered does not have the “disabled” property anymore.
const btn = wrapper.find(".someName");
expect(btn.exists()).toBe(true);
// Change value that causes computed "isDisabled" to return true
await wrapper.vm.$nextTick();
expect(btn.attributes()).not.toHaveProperty("disabled");
My real example uses a Store for the computed property so I excluded that to make the example simpler. But as previously said, the element is working fine when running the project.
Expected behavior No infinite loop.
Platform (please complete the following information): OS: Windows Node: 12.13.1 NPM: 6.12.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (9 by maintainers)
Top GitHub Comments
That does indeed solve the issue, so I will close this ticket. Thanks @k-bialucha!
@k-bialucha I will check and see if that resolves my issue as well!