diff --git a/packages/at_auth/test/at_auth_test.dart b/packages/at_auth/test/at_auth_test.dart index 9cf15bde..bc7e6e9c 100644 --- a/packages/at_auth/test/at_auth_test.dart +++ b/packages/at_auth/test/at_auth_test.dart @@ -221,6 +221,7 @@ void main() { ..rootPort = 64 ..enableEnrollment = true ..appName = 'wavi' + ..authMode = PkamAuthMode.keysFile ..deviceName = 'iphone'; final response = @@ -229,5 +230,30 @@ void main() { expect(response.isSuccessful, true); expect(response.enrollmentId, 'abc123'); }); + + test('Test onboard - enable enrollment set to false', () async { + when(() => mockAtLookUp.authenticate_cram(testCramSecret)) + .thenAnswer((_) => Future.value(true)); + when(() => mockAtLookUp.executeCommand(any())) + .thenAnswer((_) => Future.value('data:1')); + when(() => mockAtLookUp.executeVerb(any())) + .thenAnswer((_) => Future.value('data:2')); + + when(() => mockAtLookUp.close()).thenAnswer((_) async => {}); + when(() => mockPkamAuthenticator.authenticate()).thenAnswer( + (_) => Future.value(AtAuthResponse('@aliceđź› ')..isSuccessful = true)); + + final atOnboardingRequest = AtOnboardingRequest('@aliceđź› ') + ..rootDomain = 'test.atsign.com' + ..rootPort = 64 + ..enableEnrollment = false + ..appName = 'wavi' + ..deviceName = 'iphone'; + + final response = + await atAuth.onboard(atOnboardingRequest, testCramSecret); + expect(response.isSuccessful, true); + }); + }); }