From ac4db23709761fbc5772e9f0ad626f23a4cc3529 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Tue, 18 Mar 2025 15:16:26 -0300 Subject: [PATCH] Add test for unregistered user state to InAppPaymentRecurringContextJobTest. --- .../jobs/InAppPaymentRecurringContextJobTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/test/java/org/thoughtcrime/securesms/jobs/InAppPaymentRecurringContextJobTest.kt b/app/src/test/java/org/thoughtcrime/securesms/jobs/InAppPaymentRecurringContextJobTest.kt index 747b5db685..55a5770fc3 100644 --- a/app/src/test/java/org/thoughtcrime/securesms/jobs/InAppPaymentRecurringContextJobTest.kt +++ b/app/src/test/java/org/thoughtcrime/securesms/jobs/InAppPaymentRecurringContextJobTest.kt @@ -77,6 +77,18 @@ class InAppPaymentRecurringContextJobTest { } } + @Test + fun `Given user is unregistered, when I run then I expect failure`() { + every { mockSignalStore.account.isRegistered } returns true + + val iap = insertInAppPayment() + val job = InAppPaymentRecurringContextJob.create(iap) + + val result = job.run() + + assertThat(result.isFailure).isTrue() + } + @Test fun `Given a CREATED IAP, when I onAdded, then I expect PENDING`() { val iap = insertInAppPayment()