Skip to content

Commit

Permalink
do not delete app config when disabling widget
Browse files Browse the repository at this point in the history
  • Loading branch information
mvmike committed Oct 9, 2023
1 parent 0d5e08e commit f9629ff
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
package cat.mvmike.minimalcalendarwidget.application.system

import android.content.Context
import cat.mvmike.minimalcalendarwidget.domain.configuration.clearAllConfiguration
import cat.mvmike.minimalcalendarwidget.domain.intent.AutoUpdate

object DisableWidgetUseCase {

fun execute(context: Context) {
clearAllConfiguration(context)
AutoUpdate.cancel(context)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package cat.mvmike.minimalcalendarwidget.application.system

import cat.mvmike.minimalcalendarwidget.BaseTest
import cat.mvmike.minimalcalendarwidget.domain.configuration.clearAllConfiguration
import cat.mvmike.minimalcalendarwidget.domain.intent.AutoUpdate
import io.mockk.justRun
import io.mockk.mockkObject
Expand All @@ -15,13 +14,10 @@ internal class DisableWidgetUseCaseTest : BaseTest() {
@Test
fun shouldClearAllConfigurationAndCancelAutoUpdate() {
mockkObject(AutoUpdate)

justRun { clearAllConfiguration(context) }
justRun { AutoUpdate.cancel(context) }

DisableWidgetUseCase.execute(context)

verify { clearAllConfiguration(context) }
verify { AutoUpdate.cancel(context) }
}
}

0 comments on commit f9629ff

Please sign in to comment.