Add tests where deletion happens before snapshot()
This commit is contained in:
parent
e14e922c39
commit
60a58382b4
|
@ -340,6 +340,15 @@ module.exports = BaseTest.extend({
|
|||
TestCase.assertEqual(snapshot[0], null);
|
||||
});
|
||||
|
||||
realm.write(function() {
|
||||
var objects = createTestObjects(10);
|
||||
realm.deleteAll();
|
||||
|
||||
var snapshot = objects.snapshot();
|
||||
TestCase.assertEqual(objects.length, 0);
|
||||
TestCase.assertEqual(snapshot.length, 0);
|
||||
});
|
||||
|
||||
realm.write(function() {
|
||||
var objects = createTestObjects(10);
|
||||
var snapshot = objects.snapshot();
|
||||
|
@ -349,5 +358,14 @@ module.exports = BaseTest.extend({
|
|||
TestCase.assertEqual(snapshot.length, 10);
|
||||
TestCase.assertEqual(snapshot[0], null);
|
||||
});
|
||||
|
||||
realm.write(function() {
|
||||
var objects = createTestObjects(10);
|
||||
realm.delete(objects);
|
||||
|
||||
var snapshot = objects.snapshot();
|
||||
TestCase.assertEqual(objects.length, 0);
|
||||
TestCase.assertEqual(snapshot.length, 0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue