diff --git a/notes.md b/notes.md index 22638bf..ccbbafc 100644 --- a/notes.md +++ b/notes.md @@ -2,8 +2,6 @@ ## tests -getSortData shorthand - filter updateSortData diff --git a/test/.jshintrc b/test/.jshintrc index d1003e9..8d44cc0 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -5,8 +5,7 @@ "undef": true, "unused": true, "predef": { - "Masonry": false, - "checkItemPositions": false, + "Isotope": false, "asyncTest": false, "deepEqual": false, diff --git a/test/get-sort-data.js b/test/get-sort-data.js new file mode 100644 index 0000000..891f864 --- /dev/null +++ b/test/get-sort-data.js @@ -0,0 +1,22 @@ +test( 'getSortData', function() { + + 'use strict'; + + var iso = new Isotope( '#get-sort-data', { + layoutMode: 'fitRows', + getSortData: { + ninjaTurtle: '[data-ninja-turtle]', + fruit: 'span.fruit', + b: 'b parseFloat', + i: 'i parseInt' + } + }); + + var item = iso.items[0]; + + equal( item.sortData.ninjaTurtle, 'leonardo', '[data-attr] shorthand' ); + equal( item.sortData.fruit, 'watermelon', 'query selector shorthand' ); + equal( item.sortData.b, 3.14, 'parseFloat parser' ); + equal( item.sortData.i, 42, 'parseInt parser' ); + +}); diff --git a/test/index.html b/test/index.html index f736ad9..ccdc4a1 100644 --- a/test/index.html +++ b/test/index.html @@ -3,7 +3,7 @@
-