Skip to content

Commit 5cbd17e

Browse files
committed
More assertions around sync state
1 parent 9d66f52 commit 5cbd17e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dart/test/sync_test.dart

+7
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ void main() {
180180

181181
expect(db.select('select 1 from ps_sync_state where priority = ?', [i]),
182182
isNotEmpty);
183+
// A sync at this priority includes all higher priorities too, so they
184+
// should be cleared.
185+
expect(db.select('select 1 from ps_sync_state where priority < ?', [i]),
186+
isEmpty);
183187
}
184188
});
185189

@@ -192,10 +196,13 @@ void main() {
192196
isTrue);
193197
expect(db.select('SELECT powersync_last_synced_at() AS r').single,
194198
{'r': isNotNull});
199+
expect(db.select('SELECT priority FROM ps_sync_state').single,
200+
{'priority': 2147483647});
195201

196202
db.execute('SELECT powersync_clear(0)');
197203
expect(db.select('SELECT powersync_last_synced_at() AS r').single,
198204
{'r': isNull});
205+
expect(db.select('SELECT * FROM ps_sync_state'), hasLength(0));
199206
});
200207
});
201208
}

0 commit comments

Comments
 (0)