Skip to content

Commit adec14d

Browse files
author
Ivan Dlugos
committed
Sync test - make sure the generated model is updated to avoid obscure test failures
1 parent 66cf9a8 commit adec14d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/sync_test.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import 'dart:typed_data';
33

44
import 'package:test/test.dart';
55
import 'package:objectbox/objectbox.dart';
6+
import 'package:objectbox/src/bindings/constants.dart';
67

78
import 'entity.dart';
9+
import 'objectbox.g.dart';
810
import 'test_env.dart';
911

1012
// We want to have types explicit - verifying the return types of functions.
@@ -35,6 +37,13 @@ void main() {
3537
return client;
3638
}
3739

40+
test('Model Entity has sync enabled', () {
41+
final model = getObjectBoxModel().model;
42+
final entity =
43+
model.entities.firstWhere((ModelEntity e) => e.name == "TestEntity");
44+
expect(entity.hasFlag(OBXEntityFlag.SYNC_ENABLED), isTrue);
45+
});
46+
3847
test('SyncCredentials string encoding', () {
3948
// Let's check some special characters and verify the data is how it would
4049
// look like if the same shared secret was provided to the sync-server via
@@ -164,7 +173,7 @@ void main() {
164173
// Note: only available when you start a sync server manually.
165174
// Comment out the `skip: ` argument in tthe test-case definition.
166175
// run sync-server --unsecured-no-authentication --model=/path/objectbox-dart/test/objectbox-model.json
167-
// skip: 'Data sync test is disabled, Enable after running sync-server.' //
176+
skip: 'Data sync test is disabled, Enable after running sync-server.' //
168177
);
169178
} else {
170179
// TESTS to run when SYNC isn't available

0 commit comments

Comments
 (0)