question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite loop QFab/QFabAction in unit test

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Evertvdwcommented, Jun 11, 2020

That does indeed solve the issue, so I will close this ticket. Thanks @k-bialucha!

0reactions
Evertvdwcommented, Jun 9, 2020

@k-bialucha I will check and see if that resolves my issue as well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Test For Infinite Loop - java - Stack Overflow
This is my java thread run method and i want to write unit test for this method. But with infinte loop ...
Read more >
Unit Test How? Infinite Loops - Mark.VanderVoord
Today we're going to talk about infinite loops. ... But, an infinite loop is a great place to apply our powerful TEST define...
Read more >
How to unit-test infinite loops? · Issue #955 · Kozea/WeasyPrint
Lately I started setup.py test. It was the first time since about half a year. I know it's a lengthy task, it's tea-time,...
Read more >
Should a unit/integration test that may result in an infinite loop ...
I agree with Frank: unit tests should run quickly to give fast feedback. An infinite loop won't give you fast feedback!
Read more >
Testing (in)finite loops with Java 8 enabled unit tests
This post is an extension to the Infinite loops, halting problem and FindBugs containing slightly refactored core code and prepared unit ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found