0

I make some unit test in my angular project with karma and jasmine.

In a directive I have a resizable jquery-ui function on an element :

element.find(".wt-tools-content").resizable({
                resize: function (event, ui) {
                   my_action
                }
            });

And I can't trigger it in my test with jasmine, I try :

element.find(".wt-tools-content").trigger('resizable');
element.find(".wt-tools-content").resizable().trigger('resize');

And so many combination but I can't find how I can't trigger and test the code inside the resize function. I'm sure element in the directive and element in the jasmine test file is the same ;)

Someone can help me ?

Thank you ;)

jm01
  • 1
  • 2
  • It's seems to be the same problem but I think not, because i'm in jasmine. I try the solution in this link and I have this error message : Error: no such method 'resize' for resizable widget instance – jm01 Jun 09 '15 at 15:30
  • It should be `resizeTo`, and it's a clucky and not very good way to test it. Jasmine doesn't overwrite event workflows, if you're sure it's a different problem could you explain exactly how (because it looks exactly the same, the way the question is currently written) – blgt Jun 09 '15 at 15:44
  • I make a mistake, your link can help me, thank you very much ;) – jm01 Jun 10 '15 at 07:40

0 Answers0