lundi 6 juin 2016

Test angular directive - angular.element.css

I want write test for angular directive method in jasmine. How to test toHaveBeenCalled for .css method in the following code? I try to create spy for this method but always got Expected spy css to have been called.. Is it good idea to test css method call?

scope.contentPadding = () => { const bars = angular.element(element[0].querySelectorAll('.section')); if (bars.length > 0) { const bar = angular.element(bars[bars.length - 1]); bar.parent().css('padding-top', `${bar[0].offsetHeight - 10}px`); } };

Aucun commentaire:

Enregistrer un commentaire