سؤال

I have developed Backbone application with some click events and I am applying some CSS attributes to the DIV elements dynamically.

When I am writing test cases using Jasmine Framework, I want to know the click event is triggered or not.

If it is triggered, I want to confirm from Jasmine whether new CSS attributes has been applied or not.

How to check? I have already tried this answer: https://stackoverflow.com/a/23492830/3428816

and

http://www.htmlgoodies.com/beyond/javascript/js-ref/testing-dom-events-using-jquery-and-jasmine-2.0.html

Please help me

هل كانت مفيدة؟

المحلول

The answer from this link: https://stackoverflow.com/a/23492830/3428816 is correct.

I hope you are expecting real time click event will happen when you are triggering click event in Jasmine.

Event will not triggered in real. You can cover the code Whether event is triggering or not using Jasmine.

I hope this helps to understand the Jasmine event triggering.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top