I mean specifically if you are testing multiple classes in the same call, like so:

```js
expect(element).toHaveClass(‘foo bar baz’);
```

The reason is that what it’s essentially doing is checking `className.indexOf(expectedClass)`, so if they’re in the wrong order, it breaks.

It doesn’t hurt these tests, though.

Caitlin Potter
caitpotter88@gmail.com

On May 30, 2014, at 2:59 PM, Brian Ford <notifications@github.com> wrote:

> In test/ng/directive/ngClassSpec.js:
> 
> > @@ -205,6 +205,23 @@ describe('ngClass', function() {
> >        expect(e2.hasClass('odd')).toBeTruthy();
> >    }));
> >  
> > +  it('should allow ngClass with overlapping classes', inject(function($rootScope, $compile, $animate) {
> > +      element = $compile('<div ng-class="{\'same yes\': test, \'same no\': !test}"></div>')($rootScope);
> > +      $rootScope.$digest();
> > +
> > +      expect(element.hasClass('same')).toBeTruthy();
> > +      expect(element.hasClass('yes')).toBeFalsy();
> > +      expect(element.hasClass('no')).toBeTruthy();
> It has an issue with testing for multiple classes though
> 
> The custom matcher does? It looks like all it does is call hasClass internally.
> 
> —
> Reply to this email directly or view it on GitHub.
>