aboutsummaryrefslogtreecommitdiffstats
path: root/test/directivesSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/directivesSpec.js')
-rw-r--r--test/directivesSpec.js41
1 files changed, 1 insertions, 40 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 39c52ac6..bb530128 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -179,7 +179,7 @@ describe("directive", function(){
describe('ng:class', function() {
- it('should change current class or remove old classes dynamically', function() {
+ it('should add new and remove old classes dynamically', function() {
var scope = compile('<div class="existing" ng:class="dynClass"></div>');
scope.dynClass = 'A';
scope.$eval();
@@ -206,45 +206,6 @@ describe("directive", function(){
expect(element.hasClass('A')).toBeTruthy();
expect(element.hasClass('B')).toBeTruthy();
});
-
- it('should preserve class added post compilation', function() {
- var scope = compile('<div class="existing" ng:class="dynClass"></div>');
- scope.dynClass = 'A';
- scope.$eval();
- expect(element.hasClass('existing')).toBe(true);
-
- // add extra class, change model and eval
- element.addClass('newClass');
- scope.dynClass = 'B';
- scope.$eval();
-
- expect(element.hasClass('existing')).toBe(true);
- expect(element.hasClass('B')).toBe(true);
- expect(element.hasClass('newClass')).toBe(true);
- });
-
- it('should preserve class added post compilation even without existing classes"', function() {
- var scope = compile('<div ng:class="dynClass"></div>');
- scope.dynClass = 'A';
- scope.$eval();
- expect(element.hasClass('A')).toBe(true);
-
- // add extra class, change model and eval
- element.addClass('newClass');
- scope.dynClass = 'B';
- scope.$eval();
-
- expect(element.hasClass('B')).toBe(true);
- expect(element.hasClass('newClass')).toBe(true);
- });
-
- it('should preserve right classes"', function() {
- var scope = compile('<div class="ui-panel ui-selected" ng:class="dynCls"></div>');
- scope.dynCls = 'panel';
- scope.dynCls = 'foo';
- scope.$eval();
- expect(element.attr('class')).toBe('ui-panel ui-selected ng-directive foo');
- });
});