aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJoao Sa2013-06-28 00:53:17 -0300
committerPete Bacon Darwin2013-07-03 20:25:28 +0100
commit63414b965397a9fd7d2f49e8dea4b848e0d6707e (patch)
treef4fd2203cf658e8c76341789b9dc4c45136b2e2a /test
parent5f24bb0267418aa194b46c64a7dfcf07484b836d (diff)
downloadangular.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.js12
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>');
+ });
});