mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
Merge pull request #4156 from vitorpamplona/claude/nice-edison-gaf62z
Add @OptIn(ExperimentalCoroutinesApi) to calendar test classes
This commit is contained in:
+2
@@ -32,6 +32,7 @@ import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent
|
||||
import com.vitorpamplona.quartz.nip52Calendar.calendar.CalendarEvent
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
@@ -65,6 +66,7 @@ import org.junit.Test
|
||||
* `LocalCache` is a process-wide object and JUnit's method order is hash-based, so every method
|
||||
* uses its own author key and asserts only over that key's events.
|
||||
*/
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class CalendarsViewModelFlowTest {
|
||||
// viewModelScope is Dispatchers.Main, and every flow is a WhileSubscribed stateIn, so nothing
|
||||
// runs until something subscribes.
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.CalendarsViewMode
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.CalendarsViewModel
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.startOfWeek
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.resetMain
|
||||
import kotlinx.coroutines.test.setMain
|
||||
import org.junit.After
|
||||
@@ -41,6 +42,7 @@ import java.time.YearMonth
|
||||
* The paging arithmetic the calendar lenses share, now that it lives on the screen's ViewModel
|
||||
* instead of being spelled out in each view's click handlers.
|
||||
*/
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class CalendarsViewModelTest {
|
||||
// The model's derived flows are `stateIn(viewModelScope, …)`, and stateIn launches its
|
||||
// sharing coroutine as soon as the property initializer runs — so simply CONSTRUCTING the
|
||||
|
||||
Reference in New Issue
Block a user