Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ import androidx.test.espresso.Espresso.pressBack
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import io.github.chrisimx.esclmockserver.EsclMockServer
import io.github.chrisimx.scanbridge.datastore.appSettingsStore
import io.github.chrisimx.scanbridge.datastore.lastRouteStore
import io.github.chrisimx.scanbridge.datastore.shownMessagesStore
import io.github.chrisimx.scanbridge.datastore.updateSettings
import io.github.chrisimx.scanbridge.proto.copy
import kotlinx.coroutines.runBlocking
import io.github.chrisimx.scanbridge.db.ScanBridgeDb
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.koin.mp.KoinPlatform.getKoin

class ScanBridgeTest {
@get:Rule
Expand All @@ -37,22 +33,8 @@ class ScanBridgeTest {
@Before
@After
fun cleanupForTest() {
runBlocking {
composeTestRule.activity.shownMessagesStore.updateData {
it.copy {
thankPlayOne = true
}
}
composeTestRule.activity.lastRouteStore.updateData {
it.copy {
clearLastRoute()
}
}
composeTestRule.activity.appSettingsStore.updateSettings {
clearLastUsedScanSettings()
autoCleanup = true
}
}
val scanBridgeDb: ScanBridgeDb = getKoin().get()
scanBridgeDb.clearAllTables()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ import androidx.test.rule.GrantPermissionRule
import io.github.chrisimx.esclmockserver.EsclMockServer
import io.github.chrisimx.scanbridge.BuildConfig
import io.github.chrisimx.scanbridge.MainActivity
import io.github.chrisimx.scanbridge.datastore.appSettingsStore
import io.github.chrisimx.scanbridge.datastore.lastRouteStore
import io.github.chrisimx.scanbridge.datastore.shownMessagesStore
import io.github.chrisimx.scanbridge.datastore.updateSettings
import io.github.chrisimx.scanbridge.proto.copy
import kotlinx.coroutines.runBlocking
import io.github.chrisimx.scanbridge.db.ScanBridgeDb
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.koin.mp.KoinPlatform.getKoin
import tools.fastlane.screengrab.Screengrab
import tools.fastlane.screengrab.locale.LocaleTestRule

Expand Down Expand Up @@ -56,22 +52,8 @@ class ScanBridgeScreenshotTest {

@Before
fun cleanupForTest() {
runBlocking {
composeTestRule.activity.shownMessagesStore.updateData {
it.copy {
thankPlayOne = true
}
}
composeTestRule.activity.lastRouteStore.updateData {
it.copy {
clearLastRoute()
}
}
composeTestRule.activity.appSettingsStore.updateSettings {
clearLastUsedScanSettings()
autoCleanup = true
}
}
val scanBridgeDb: ScanBridgeDb = getKoin().get()
scanBridgeDb.clearAllTables()
}

@Test
Expand Down
Loading
Loading