/**
 * list.spec.js
 * (c) 2013~ Youngteac Hong
 * summernote may be freely distributed under the MIT license./
 */
var list = $.fn.summernoteInner().list;

test('list.compact', function() {
  deepEqual(list.compact([0, 1, false, 2, '', 3]), [1,2,3],
            'falsey values of `array` removed');
});

test('list.clusterBy', function() {
  var aaClustered = list.clusterBy([1, 1, 2, 2, 3], function(itemA, itemB) {
    return itemA === itemB;
  });
  deepEqual([[1, 1], [2, 2], [3]], aaClustered, 'clusterBy equality 1');
  
  var aaClustered = list.clusterBy([1, 2, 2, 1, 3], function(itemA, itemB) {
    return itemA === itemB;
  });
  deepEqual([[1], [2, 2], [1], [3]], aaClustered, 'clusterBy equality 2');
});

@@ -161,23 +161,20 @@
 t('list.
-compact
+head
 ', funct
@@ -202,96 +202,395 @@
 ist.
-compact(%5B0, 1, false, 2, '', 3%5D), %5B1,2,3%5D,%0A            'falsey values of %60array%60 removed
+head(%5B1, 2, 3%5D), 1, 'should return the first element');%0A%7D);%0A%0Atest('list.last', function() %7B%0A  deepEqual(list.last(%5B1, 2, 3%5D), 3, 'should return the last element');%0A%7D);%0A%0Atest('list.initial', function() %7B%0A  deepEqual(list.initial(%5B1, 2, 3%5D), %5B1, 2%5D, 'should exclude last element');%0A%7D);%0A%0Atest('list.tail', function() %7B%0A  deepEqual(list.tail(%5B1, 2, 3%5D), %5B2, 3%5D, 'should exclude first element
 ');%0A
@@ -786,32 +786,40 @@
 Clustered, '
+should 
 cluster
-B
+ b
 y equality 1
@@ -987,24 +987,32 @@
 tered, '
+should 
 cluster
-B
+ b
 y equali
@@ -1015,16 +1015,152 @@
 uality 2');%0A%7D);%0A
+%0Atest('list.compact', function() %7B%0A  deepEqual(list.compact(%5B0, 1, false, 2, '', 3%5D), %5B1,2,3%5D, 'falsey values of %60array%60 removed');%0A%7D);%0A

Add list function tests.