From d074425e44ac51cb395084fe65c055de8e41c4d1 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 5 Sep 2013 21:52:53 -0400 Subject: [PATCH] get sort data test title --- notes.md | 2 -- test/.jshintrc | 3 +-- test/get-sort-data.js | 22 ++++++++++++++++++++++ test/index.html | 12 +++++++++++- test/tests.css | 38 +++++++------------------------------- 5 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 test/get-sort-data.js 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 @@ - Masonry tests + Isotope tests @@ -28,6 +28,7 @@ + @@ -48,6 +49,15 @@
A2
+

getSortData

+ +
+
+ watermelon + 3.14 + 42 +
+
diff --git a/test/tests.css b/test/tests.css index d3f8e3d..18f3027 100644 --- a/test/tests.css +++ b/test/tests.css @@ -15,12 +15,18 @@ body { position: relative; } +.container:after { + content: ''; + display: block; + clear: both; +} + .item { width: 60px; height: 30px; float: left; border: 1px solid; - background: #09F; + background: #3BF; } .item.w2 { width: 120px; } @@ -38,15 +44,6 @@ body { border: 1px solid; } - -/* ---- gutter ---- */ - -#gutter { - width: 220px; -} - -#gutter .item.w2 { width: 140px; } - /* ---- stamp ---- */ .has-stamp .item { width: 45px; } @@ -62,24 +59,3 @@ body { width: 200px; height: 20px; } - -#stamp-top-left .stamp1 { - left: 70px; - top: 10px; -} - -#stamp-top-left .stamp2 { - left: -5px; - top: 0; -} - -#stamp-bottom-right .stamp1 { - right: 70px; - bottom: 10px; -} - -#stamp-bottom-right .stamp2 { - right: -5px; - bottom: 0; -} -