opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

JQM widget only being rendered the first time in a directive test #146

Closed jperl closed 11 years ago

jperl commented 11 years ago

I am attempting to do directive testing in the style of the ng-directive-testing project.

Here is my spec.

The first and second test are identical, but they output different html.

The first test outputs

<div class="ui-checkbox"><label for="checked" class="ng-binding ui-checkbox-on ui-btn ui-btn-up-c ui-btn-corner-all ui-fullsize ui-btn-icon-null" data-corners="true" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-icon="checkbox-on" data-iconpos="null" data-theme="c" data-mini="false"><span class="ui-btn-inner"><span class="ui-btn-text">First</span><span class="ui-icon ui-icon-checkbox-on ui-icon-shadow">&nbsp;</span></span></label><input type="checkbox" ng-model="todo.completed" id="checked" data-ngm-checkboxradio="[]" class="ng-pristine ng-valid"></div>.

The second test outputs

`

` Only in the first test the JQM widgets are applied properly. How can I get the directive to render the same way in both tests?
jperl commented 11 years ago

Wait on answering this, I might have found what I need in here.

jperl commented 11 years ago

I updated the tests to use the unittestTools but I still can't figure it out. Please help :)

tbosch commented 11 years ago

Hi, please try again with the angular-mocks that I am using in the adapter (directory test/lib). I am using an older version there, which works well.

Tobias

jperl commented 11 years ago

THANK YOU!!!!!!!!!!!!!