ディレクティブを書きます。テンプレートでは、ng-repeat 内で ng-include を使用しました。
<div ng-repeat="page in wStepPages" id="step{{$index}}" data-ng-show="getCurrentStep() == $index" ng-include="page.page" class="slide-frame">
</div>
たとえば、私の page.page = step1.html の場合:
<div>
<input id="name" ng-model="isolate.name">
</div>
そして私のtestSpecで:
describe("test_wizard",function () {
var scope,doc,elem,compiled,html;
beforeEach(module('App.wizard','app/partials/step1.html','app/partials/step2.html','app/partials/step3.html','app/partials/step4.html'));
beforeEach(function(){
html = '<ov-wizard title="OV_WIZARD" step-pages="stepPages" confirm-bt="confirmbt" data="wizardData"></ov-wizard>';
inject(function($compile, $rootScope){
scope = $rootScope.$new();
elem = angular.element(html);
compiled = $compile(elem);
compiled(scope);
scope.$digest();
})
});
it("do some thing",function(){
expect(elem.find("#name").length).toEqual(1);
});
})
しかし、返品は0件です。助けて!