Revert inventory changes, fix test

pull/1381/head
Alex Baker 3 years ago
parent c0a3c0e2c6
commit 3973c9e7bb

@ -1,5 +1,6 @@
package org.tasks.caldav
import androidx.test.annotation.UiThreadTest
import com.todoroo.astrid.helper.UUIDHelper
import dagger.hilt.android.testing.HiltAndroidTest
import dagger.hilt.android.testing.UninstallModules
@ -18,9 +19,11 @@ class CaldavSubscriptionTest : CaldavTest() {
@Inject lateinit var inventory: Inventory
@Test
@UiThreadTest
fun cantSyncWithoutPro() = runBlocking {
preferences.setBoolean(R.string.p_debug_pro, false)
inventory.clear()
inventory.add(emptyList())
account = CaldavAccount().apply {
uuid = UUIDHelper.newUUID()

@ -34,9 +34,7 @@ class Inventory @Inject constructor(
fun clear() {
Timber.d("clear()")
purchases.clear()
subscription.postValue(null)
hasTasksSubscription = false
hasPro = false
subscription.value = null
}
fun add(items: Iterable<Purchase>) {

Loading…
Cancel
Save