diff options
| author | Joao Sa | 2013-06-28 00:53:17 -0300 | 
|---|---|---|
| committer | Igor Minar | 2013-07-02 23:24:51 -0700 | 
| commit | fd87eb0ca5e14f213d8b31280d444dbc29c20c50 (patch) | |
| tree | 6fdf7198d1cfe8b0955ad217b6f9b4dc0bcd4f3e /test/jqLiteSpec.js | |
| parent | 3ffddad100e993403d13137387d0685466b46b2b (diff) | |
| download | angular.js-fd87eb0ca5e14f213d8b31280d444dbc29c20c50.tar.bz2 | |
fix(jqLite): prepend array in correct order
Match jQuery behavior when prepending array into empty element
Diffstat (limited to 'test/jqLiteSpec.js')
| -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 f6630536..92ccc2a8 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -1075,6 +1075,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>'); +    });    }); | 
