describe('attributeName filter', function() {
  var filter;
  beforeEach(angular.mock.module('PraxisDocBrowser'));

  beforeEach(inject(function(attributeNameFilter, $sce) {
    filter = function(input) {
      return $sce.getTrusted('html', attributeNameFilter(input));
    };
  }));

  it('only modifies input with one dot', function() {
    expect(function(str) {
      var dotsCount = str.split('.').length - 1;
      if (dotsCount !== 1) {
        return str === filter(str);
      }
    }).forAll(qc.string);
  });

  it('adds a tag to the prefix', function() {
    expect(filter('ns.test')).toEqual('<span class="attribute-prefix">ns.</span>test');
  });
});

describe('attributeName filter', function() {
  var filter;
  beforeEach(angular.mock.module('PraxisDocBrowser'));

  beforeEach(inject(function(attributeNameFilter, $sce) {
    filter = function(input) {
      return $sce.getTrusted('html', attributeNameFilter(input));
    };
  }));

  it('only modifies input with one or more dots', function() {
    expect(function(str) {
      var dotsCount = str.split('.').length - 1;
      if (dotsCount === 0) {
        return str === filter(str);
      }
    }).forAll(qc.string);
  });

  it('adds a tag to the prefix', function() {
    expect(filter('ns.test')).toEqual('<span class="attribute-prefix">ns.</span>test');
  });
});

Fix the broken js spec that started failing when sub-attributes were properly grayed out.
Fix the broken js spec that started failing when sub-attributes were properly grayed out.

Signed-off-by: Josep M. Blanquer <843d9a062ab1c6792ebebca5589f22ce86ac85ce@gmail.com>