diff options
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 7fe65f4c..117e8fb0 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -190,7 +190,7 @@ describe('angular', function() { expect(copy.key).toBe(original.key); }); - it('should not copy $$ properties nor prototype properties', function() { + it('should omit "$$"-prefixed properties', function() { var original = {$$some: true, $$: true}; var clone = {}; @@ -198,6 +198,27 @@ describe('angular', function() { expect(clone.$$some).toBeUndefined(); expect(clone.$$).toBeUndefined(); }); + + it('should copy "$"-prefixed properties from copy', function() { + var original = {$some: true}; + var clone = {}; + + expect(shallowCopy(original, clone)).toBe(clone); + expect(clone.$some).toBe(original.$some); + }); + + it('should omit properties from prototype chain', function() { + var original, clone = {}; + function Func() {}; + Func.prototype.hello = "world"; + + original = new Func(); + original.goodbye = "world"; + + expect(shallowCopy(original, clone)).toBe(clone); + expect(clone.hello).toBeUndefined(); + expect(clone.goodbye).toBe("world"); + }); }); describe('elementHTML', function() { |
