diff options
| author | Caitlin Potter | 2014-01-07 20:27:45 -0500 |
|---|---|---|
| committer | Caitlin Potter | 2014-02-21 17:59:01 -0500 |
| commit | 75515852ea9742d3d84a0f463c2a2c61ef2b7323 (patch) | |
| tree | c1a778f6a950ea8a658142ea6c5ce573bf51e6a8 /test/AngularSpec.js | |
| parent | 5fe1f39f027c6f2c6a530975dd5389d788d3c0eb (diff) | |
| download | angular.js-75515852ea9742d3d84a0f463c2a2c61ef2b7323.tar.bz2 | |
fix(isElement): reduce false-positives in isElement tests
Complimentary change to match changed $parse behaviour.
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 117e8fb0..aa5a5f7b 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1127,5 +1127,25 @@ describe('angular', function() { expect(result).toEqual(expected[idx]); }); })); + + // Issue #4805 + it('should return false for objects resembling a Backbone Collection', function() { + // Backbone stuff is sort of hard to mock, if you have a better way of doing this, + // please fix this. + var fakeBackboneCollection = { + children: [{}, {}, {}], + find: function() {}, + on: function() {}, + off: function() {}, + bind: function() {} + }; + expect(isElement(fakeBackboneCollection)).toBe(false); + }); + + it('should return false for arrays with node-like properties', function() { + var array = [1,2,3]; + array.on = true; + expect(isElement(array)).toBe(false); + }); }); }); |
