angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Missing testing function in ngClassSpec

Open mofas opened this issue 12 years ago • 2 comments

I find there are two unit test in ngClassSpec.js do not have any test function

  it('should remove classes even if they were added by another code', inject(function($rootScope, $compile) {
    element = $compile('<div ng-class="dynCls"></div>')($rootScope);
    $rootScope.dynCls = 'foo';
    $rootScope.$digest();
    element.addClass('foo');
    $rootScope.dynCls = '';
    $rootScope.$digest();
  }));
  it('should convert undefined and null values to an empty string', inject(function($rootScope, $compile) {
    element = $compile('<div ng-class="dynCls"></div>')($rootScope);
    $rootScope.dynCls = [undefined, null];
    $rootScope.$digest();
  }));

Are they deliberate or just forget to add?

mofas avatar Dec 04 '13 01:12 mofas

Good spot @mofas . Do you think you could knock up a PR to improve these two cases?

petebacondarwin avatar Dec 05 '13 13:12 petebacondarwin

I’d mentioned these when I wrote the ngAttr directive for fun — I think the assumption was that the tests were failing or something, and not using xit/xdescribe.

Caitlin Potter [email protected]

On Dec 5, 2013, at 8:44 AM, Pete Bacon Darwin [email protected] wrote:

Good spot @mofas . Do you think you could knock up a PR to improve these two cases?

— Reply to this email directly or view it on GitHub.

caitp avatar Dec 05 '13 13:12 caitp