js-must icon indicating copy to clipboard operation
js-must copied to clipboard

Hangs the browser when checking must.be.equal

Open tavriaforever opened this issue 11 years ago • 2 comments

Hello! Write tests on the button. When clicking on the button - it should be in focus, but due to the button for other reasons does not receive focus and document.activeElement not equal to the button, and equal document.body. In this case, the test was just to fail, but after my code - crashes the browser(any) or does not hang, but is not performed afterEach. My code:

var sliderRunner = $('.slider__runner');
sliderRunner.focus();
sliderRunner.get(0).must.equal(document.activeElement);

I tried in different ways:

sliderRunner.get(0).must.be.equal(document.activeElement);
sliderRunner.get(0).must.eql(document.activeElement); //recursive

tavriaforever avatar Jan 16 '14 15:01 tavriaforever

Hey!

Thanks for taking the time to let me know about this and sorry about the trouble!

I'm guessing it could be an issue with trying to serialize the DOM element to report the failure (something like foo must equal bar). I'll take a look and see how to tone down the serialization for cases where it might take too long.

moll avatar Jan 16 '14 15:01 moll

@moll Hi! What is the status of this issue?

alexbaumgertner avatar Aug 03 '15 11:08 alexbaumgertner