sorry, I fumbled some hotkey and my browser posted this before I was done: let me finish.
elem is the compiled angular element that has my directive. This does not work:
var the_input=elem.find("..selector for my input...");
expect(the_input.length).toBe(1);
expect(the_input.val()).toBe('2');
the_input.val('10');
expect(the_input.val()).toBe('10');
elem.scope().$apply()
//all good up to here, but looking at the DOM the change has not been applied
This, on the other hand works:
elem.scope().the_variable=10;
elem.scope().$apply()
//all good, change has been applied to DOM
Note that the_variable and the_input are bound together. Here is the input element:
<input type="number"
name="the_variable"
ng-model="lltable.display_rows"
max="1000"
min="1"
class="input-small"
ng-change="current_page=0">
This works fine in the browser, my only problem is with the test.
Any ideas for what could be wrong?
thanks
Paolo