-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
357bb2a
commit 4c4c2d4
Showing
1 changed file
with
17 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,20 +67,18 @@ class LinkApiRepositoryTest { | |
|
||
@Test | ||
fun `lookupConsumer sends correct parameters`() = runTest { | ||
val email = "[email protected]" | ||
val consumersApiService = FakeConsumersApiService() | ||
val linkRepository = linkRepository(consumersApiService) | ||
|
||
val result = linkRepository.lookupConsumer(email) | ||
val result = linkRepository.lookupConsumer(EMAIL) | ||
|
||
assertThat(result).isEqualTo(Result.success(TestFactory.CONSUMER_SESSION_LOOKUP)) | ||
assertThat(consumersApiService.lookupCalls).containsExactly( | ||
FakeConsumersApiService.LookupCall( | ||
email = email, | ||
requestSurface = CONSUMER_SURFACE, | ||
requestOptions = ApiRequest.Options(PUBLISHABLE_KEY, STRIPE_ACCOUNT_ID) | ||
) | ||
) | ||
assertThat(consumersApiService.lookupCalls.size).isEqualTo(1) | ||
val lookup = consumersApiService.lookupCalls.first() | ||
assertThat(lookup.email).isEqualTo(EMAIL) | ||
assertThat(lookup.requestSurface).isEqualTo(CONSUMER_SURFACE) | ||
assertThat(lookup.requestOptions.apiKey).isEqualTo(PUBLISHABLE_KEY) | ||
assertThat(lookup.requestOptions.stripeAccount).isEqualTo(STRIPE_ACCOUNT_ID) | ||
} | ||
|
||
@Test | ||
|
@@ -116,17 +114,16 @@ class LinkApiRepositoryTest { | |
) | ||
|
||
assertThat(result).isEqualTo(Result.success(TestFactory.CONSUMER_SESSION_LOOKUP)) | ||
assertThat(consumersApiService.mobileLookupCalls).containsExactly( | ||
FakeConsumersApiService.MobileLookupCall( | ||
email = EMAIL, | ||
requestSurface = CONSUMER_SURFACE, | ||
verificationToken = VERIFICATION_TOKEN, | ||
appId = APP_ID, | ||
emailSource = EMAIL_SOURCE, | ||
sessionId = SESSION_ID, | ||
requestOptions = ApiRequest.Options(PUBLISHABLE_KEY, STRIPE_ACCOUNT_ID) | ||
) | ||
) | ||
assertThat(consumersApiService.mobileLookupCalls.size).isEqualTo(1) | ||
val lookup = consumersApiService.mobileLookupCalls.first() | ||
assertThat(lookup.email).isEqualTo(EMAIL) | ||
assertThat(lookup.requestSurface).isEqualTo(CONSUMER_SURFACE) | ||
assertThat(lookup.verificationToken).isEqualTo(VERIFICATION_TOKEN) | ||
assertThat(lookup.appId).isEqualTo(APP_ID) | ||
assertThat(lookup.emailSource).isEqualTo(EMAIL_SOURCE) | ||
assertThat(lookup.sessionId).isEqualTo(SESSION_ID) | ||
assertThat(lookup.requestOptions.apiKey).isEqualTo(PUBLISHABLE_KEY) | ||
assertThat(lookup.requestOptions.stripeAccount).isEqualTo(STRIPE_ACCOUNT_ID) | ||
} | ||
|
||
@Test | ||
|