1package soy.iko.opencode
3import androidx.test.core.app.ApplicationProvider
4import androidx.test.ext.junit.runners.AndroidJUnit4
5import org.junit.Assert.assertNotNull
6import org.junit.Assert.assertTrue
8import org.junit.runner.RunWith
11 * Smoke test for the [OpencodeApp] Application bootstrap: the container and crash logger
12 * are initialized on startup, and the notification channels are created.
14@RunWith(AndroidJUnit4::class)
15class ApplicationBootstrapTest {
18 fun containerIsInitialized() {
19 val app = ApplicationProvider.getApplicationContext<OpencodeApp>()
20 assertNotNull(app.container)
21 assertNotNull(app.container.settingsStore)
25 fun notificationChannelsExist() {
26 if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) return
27 val context = ApplicationProvider.getApplicationContext<android.content.Context>()
28 // Touching the app instance runs Application.onCreate, which creates the channels.
29 ApplicationProvider.getApplicationContext<OpencodeApp>()
30 val nm = context.getSystemService(android.content.Context.NOTIFICATION_SERVICE)
31 as android.app.NotificationManager
32 val ids = nm.notificationChannels.map { it.id }
33 assertTrue("status channel should exist, got $ids", ids.contains("run_status"))
34 assertTrue("completed channel should exist, got $ids", ids.contains("session_completed"))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list