diff options
| author | Joao Sa | 2013-06-28 00:53:17 -0300 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-07-03 20:25:28 +0100 |
| commit | 63414b965397a9fd7d2f49e8dea4b848e0d6707e (patch) | |
| tree | f4fd2203cf658e8c76341789b9dc4c45136b2e2a /test | |
| parent | 5f24bb0267418aa194b46c64a7dfcf07484b836d (diff) | |
| download | angular.js-63414b965397a9fd7d2f49e8dea4b848e0d6707e.tar.bz2 | |
fix(jqLite): prepend array in correct order
Match jQuery behavior when prepending array into empty element
Diffstat (limited to 'test')
| -rw-r--r-- | test/jqLiteSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 7412c8c4..6aafd1f8 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -1023,6 +1023,18 @@ describe('jqLite', function() { expect(root.prepend('abc')).toEqual(root); expect(root.html().toLowerCase()).toEqual('abctext'); }); + it('should prepend array to empty in the right order', function() { + var root = jqLite('<div>'); + expect(root.prepend([a, b, c])).toBe(root); + expect(sortedHtml(root)). + toBe('<div><div>A</div><div>B</div><div>C</div></div>'); + }); + it('should prepend array to content in the right order', function() { + var root = jqLite('<div>text</div>'); + expect(root.prepend([a, b, c])).toBe(root); + expect(sortedHtml(root)). + toBe('<div><div>A</div><div>B</div><div>C</div>text</div>'); + }); }); |
