0
剣道テンプレートHtmlを使用する関数のカルマテストを書こうとしています。剣道用カルマジャスミンユニットテストテンプレート
コードは次のようになります:
$scope.columns = [{
field: gridColumns.STATUS,
title: gridColumnsTitle.STATUS,
template: $scope.getKendoTemplate($("#statusTemplate").html()),
width: 80
}];
問題が定義されていないHTMLテンプレート$("#statusTemplate").html()
です。 そして、私はこのようなエラーが出ます:
TypeError: Cannot read property 'replace' of undefined
at Object.compile (app/js/kendo.all.min.js:25:7431)
at new proxy (wwwroot/lib/jquery/dist/jquery.js:497:14)
at ChildScope.getKendoTemplate (app/components/test/demo/demo.controller.es5.js:9:22664)
そして#statusTemplateのためのコードは、HTMLにこのように書きます:
<script type="text/x-kendo-template" id="statusTemplate">
<span data-ng-show="dataItem.active">On</span>
<span data-ng-show="!dataItem.active">Off</span>
</script>
は、私は、このユニットテストが渡される可能性が方法はあります。実際のコードに大きな変更を加えることなく。私はgetKendoTemplateをスパイ終わる