parent
0c4dfcb914
commit
4705b6b3a5
|
@ -278,5 +278,32 @@ module.exports = BaseTest.extend({
|
||||||
TestCase.assertEqual(objects[0].boolCol, true, 'first element descending for boolCol');
|
TestCase.assertEqual(objects[0].boolCol, true, 'first element descending for boolCol');
|
||||||
TestCase.assertEqual(objects[1].boolCol, false, 'second element descending for boolCol');
|
TestCase.assertEqual(objects[1].boolCol, false, 'second element descending for boolCol');
|
||||||
TestCase.assertEqual(objects[2].boolCol, false, 'third element descending for boolCol');
|
TestCase.assertEqual(objects[2].boolCol, false, 'third element descending for boolCol');
|
||||||
|
},
|
||||||
|
|
||||||
|
testResultsInvalidation: function() {
|
||||||
|
var realm = new Realm({schema: [schemas.TestObject]});
|
||||||
|
var testObjects = realm.objects('TestObject');
|
||||||
|
var filteredObjects = testObjects.filtered('doubleCol > 1');
|
||||||
|
var sortedObjects = testObjects.sorted('doubleCol');
|
||||||
|
var snapshotObjects = testObjects.snapshot();
|
||||||
|
|
||||||
|
realm.close();
|
||||||
|
|
||||||
|
realm = new Realm({
|
||||||
|
schemaVersion: 1,
|
||||||
|
schema: [schemas.TestObject, schemas.BasicTypes]
|
||||||
|
});
|
||||||
|
|
||||||
|
[
|
||||||
|
testObjects,
|
||||||
|
filteredObjects,
|
||||||
|
sortedObjects,
|
||||||
|
snapshotObjects,
|
||||||
|
].forEach(function(objects) {
|
||||||
|
TestCase.assertThrows(function() { objects[0]; });
|
||||||
|
TestCase.assertThrows(function() { objects.filtered('doubleCol < 42'); });
|
||||||
|
TestCase.assertThrows(function() { objects.sorted('doubleCol', true); });
|
||||||
|
TestCase.assertThrows(function() { objects.snapshot(); });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue