diff --git a/packages/realm_dart/test/client_reset_test.dart b/packages/realm_dart/test/client_reset_test.dart index 5e76c177a..3f96576d3 100644 --- a/packages/realm_dart/test/client_reset_test.dart +++ b/packages/realm_dart/test/client_reset_test.dart @@ -145,9 +145,9 @@ void main() { final clientResetFuture = onManualResetFallback.future.wait(defaultWaitTimeout, "onManualResetFallback is not reported."); await expectLater( - clientResetFuture, - throwsA(isA().having((e) => e.innerError?.toString(), 'innerError', 'Exception: This fails!').having((e) => e.toString(), 'message', - "ClientResetError message: A fatal error occurred during client reset: 'User-provided callback failed', inner error: 'Exception: This fails!'"))); + clientResetFuture, + throwsA(isA().having((e) => e.code, 'code', SyncErrorCode.autoClientResetFailed)), + ); }); baasTest('$clientResetHandlerType.onManualResetFallback invoked when throw in onAfterReset', (appConfig) async { @@ -173,11 +173,9 @@ void main() { final clientResetFuture = onManualResetFallback.future.wait(defaultWaitTimeout, "onManualResetFallback is not reported."); await expectLater( - clientResetFuture, - throwsA(isA().having((e) => e.innerError?.toString(), 'innerError', 'Exception: This fails too!').having( - (e) => e.toString(), - 'message', - "ClientResetError message: A fatal error occurred during client reset: 'User-provided callback failed', inner error: 'Exception: This fails too!'"))); + clientResetFuture, + throwsA(isA().having((e) => e.code, 'code', SyncErrorCode.autoClientResetFailed)), + ); }); baasTest('$clientResetHandlerType.onBeforeReset and onAfterReset are invoked', (appConfig) async {