summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/dataview/dataview.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/dataview/dataview.js b/tests/dataview/dataview.js
index 178c6df..c1eb384 100644
--- a/tests/dataview/dataview.js
+++ b/tests/dataview/dataview.js
@@ -377,7 +377,7 @@ test("all then none", function() {
assertConsistency(dv);
});
-test("inlining replaces returns", function() {
+test("inlining replaces absolute returns", function() {
var dv = new Slick.Data.DataView({ inlineFilters: true });
dv.setItems([{id:0,val:0},{id:1,val:1},{id:2,val:2}]);
dv.setFilter(function(o) {
@@ -394,6 +394,23 @@ test("inlining replaces returns", function() {
assertConsistency(dv);
});
+test("inlining replaces evaluated returns", function() {
+ var dv = new Slick.Data.DataView({ inlineFilters: true });
+ dv.setItems([{id:0,val:0},{id:1,val:1},{id:2,val:2}]);
+ dv.setFilter(function(o) {
+ if (o.val === 0) { return o.id === 2; }
+ else if (o.val === 1) { return o.id === 2 }
+ return o.val === 2});
+ same(dv.getLength(), 1, "one row is remaining");
+
+ dv.onRowsChanged.subscribe(function() { ok(false, "onRowsChanged called") });
+ dv.onRowCountChanged.subscribe(function() { ok(false, "onRowCountChanged called") });
+ dv.onPagingInfoChanged.subscribe(function() { ok(false, "onPagingInfoChanged called") });
+ same(dv.getItems().length, 3, "original data is still there");
+ same(dv.getLength(), 1, "rows are filtered");
+ assertConsistency(dv);
+});
+
module("updateItem");
test("basic", function() {