答案 0 :(得分:2)
您的代码转换清楚地表明您在某处包含 JCF - JavaScript Custom Forms
库:
describe("test", function () {
var element,
scope,
otherScope
mockData = [
{
isModalVisible: true
},
{
isModalVisible: false
}
];
beforeEach(angular.mock.module("myApp.directives"));
beforeEach(inject(function($rootScope, $compile) {
scope = $rootScope.$new();
scope.agg = mockData;
element = "<test figures=\"agg\"></test>";
element = $compile(element)(scope);
angular.element(document.body).append(element);
scope.$digest();
otherScope = element.isolateScope();
spyOn(otherScope, "init");
}));
//This one doesn't work
it("should close all modals by default", function () {
expect(otherScope.init).toHaveBeenCalled();
});
});
在<span class="jcf-select jcf-unselectable jcf-select-form-control">
_____________^__________^________________^
<select name="activitytype" class="form-control jcf-reset-appearance" value="" style=...>
________________________________________________^
内查看并确保评论所有plugins.js
代码或将其删除,例如:
jcf
希望这有帮助。