/** * list.spec.js * (c) 2013~ Alan Hong * summernote may be freely distributed under the MIT license./ */ var list = $.fn.summernoteInner().list; test('list.head', function() { deepEqual(list.head([1, 2, 3]), 1, 'should return the first element'); }); test('list.last', function() { deepEqual(list.last([1, 2, 3]), 3, 'should return the last element'); }); test('list.initial', function() { deepEqual(list.initial([1, 2, 3]), [1, 2], 'should exclude last element'); }); test('list.tail', function() { deepEqual(list.tail([1, 2, 3]), [2, 3], 'should exclude first element'); }); test('list.sum', function() { deepEqual(list.sum([1, 2, 3]), 6, 'should return 6'); deepEqual(list.sum([1, 2, 3], function(v) { return v * 2; }), 12, 'should return 12'); }); test('list.from', function() { var $cont, $b, $u, $s, $i; $cont = $('