angularjs - Unexpected request GET feature/app/public.html No more request expected $digest already in progress -
am writing unit test case testing <tabs><pane title="my first tab"></pane></tabs>
reference :directive tab pane unit tests
beforeeach(inject(function ($rootscope, $compile, $injector) { httpbackend = $injector.get('$httpbackend'); elm = angular.element( '<div>' + '<tabs>' + '<pane title="first tab">' + 'first content ' + '</pane>' + '<pane title="second tab">' + 'second content ' + '</pane>' + '</tabs>' + '</div>'); scope = $rootscope; $compile(elm)(scope); scope.$digest(); httpbackend.whenget('feature/app/public.htm').respond(elm); })); it('should create clickable titles', function () { console.log(elm.find('ul.nav-tabs')); var titles = elm.find('ul.nav-tabs li a'); expect(titles.length).tobe(2); expect(titles.eq(0).text()).tobe('first tab'); expect(titles.eq(1).text()).tobe('second tab'); });
because scope.$digest(); giving above error added httpbackend load template.but error still seems exist. please suggest possible fixes above error
Comments
Post a Comment