From 120d7ad80be7477f24f3b0590b59be851375d81f Mon Sep 17 00:00:00 2001 From: Nate Abele Date: Mon, 25 Jan 2016 12:22:07 -0500 Subject: [PATCH] fix(uiSrefActive): allow multiple classes Fixes #2481, #2482 --- test/stateDirectivesSpec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/stateDirectivesSpec.js b/test/stateDirectivesSpec.js index 91861be16..b46ff4792 100644 --- a/test/stateDirectivesSpec.js +++ b/test/stateDirectivesSpec.js @@ -654,6 +654,17 @@ describe('uiSrefActive', function() { expect(angular.element(template[0].querySelector('a')).attr('class')).toBe('active'); })); + it('should allow multiple classes to be supplied', inject(function($rootScope, $q, $compile, $state) { + template = $compile('
Contacts
')($rootScope); + $rootScope.$digest(); + var a = angular.element(template[0].getElementsByTagName('a')[0]); + + $state.transitionTo('contacts.item.edit', { id: 1 }); + $q.flush(); + timeoutFlush(); + expect(a.attr('class')).toMatch(/active also-active/); + })); + describe('ng-{class,style} interface', function() { it('should match on abstract states that are included by the current state', inject(function($rootScope, $compile, $state, $q) { el = $compile('
Roles
')($rootScope);