Skip to content

Commit

Permalink
Add test for use of asymmetric objects with disconnectedSync
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Sep 18, 2023
1 parent 0a92004 commit c214a5b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/asymmetric_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ Future<void> main([List<String>? args]) async {
await setupTests(args);

Future<Realm> getSyncRealm(AppConfiguration config) async {
return await (AppConfiguration config, List<SchemaObject> schemas) async {
final app = App(config);
final user = await getAnonymousUser(app);
final realmConfig = Configuration.flexibleSync(user, schemas);
return getRealm(realmConfig);
}(config, [Asymmetric.schema, Embedded.schema, Symmetric.schema]);
final app = App(config);
final user = await getAnonymousUser(app);
final realmConfig = Configuration.flexibleSync(user, [Asymmetric.schema, Embedded.schema, Symmetric.schema]);
return getRealm(realmConfig);
}

baasTest('Asymmetric objects die even before upload', (config) async {
Expand Down Expand Up @@ -116,6 +114,11 @@ Future<void> main([List<String>? args]) async {
throws<RealmException>("Asymmetric table 'Asymmetric' not allowed in a local Realm"));
});

test("Asymmetric don't work with disconnectedSync", () {
final config = Configuration.disconnectedSync([Asymmetric.schema, Embedded.schema, Symmetric.schema], path: 'asymmetric_disconnected.realm');
expect(() => Realm(config), throws<RealmException>());
});

// TODO
// Test that asymmetric objects are actually transferred to backend, once we have
// a mongoClient to query the backend with.
Expand Down

0 comments on commit c214a5b

Please sign in to comment.