weather: route captures, deterministic fixtures, dead grip fixed
- Commit
8491f67b318721ee280a12abdaff9bf0941413fd- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-02 02:08 UTC (4 days ago)
- Parents
4c1bdb0
Lint campaign b200e8d9d (agent tail-4, merged by hand): - RouteScreenshotCoverage: 5-home and 6-search-location captures (stateless SearchLocationContent extracted). - WeatherMap native surface exemption. - FixtureDeterminism: relative-time exceptions + fixes. - NoDeadClick: LocationsScreen reorder grip demoted from IconButton to plain container (gesture owned by draggableHandle). Agent verification: :weather:lint :lintVitalRelease :testDevUnitTest (249) :compileReleaseKotlin green; parent re-ran :weather:lintVitalRelease green. Weather conflict merges adopted wt-lint-tail4 versions of the three overlap files (LocationsScreen + two test files); parent verified by the lint run above.
Diff
docs/structure/exceptions.tsv
diff --git a/docs/structure/exceptions.tsv b/docs/structure/exceptions.tsvindex fff3855ea8..14caf4a469 100644--- a/docs/structure/exceptions.tsv+++ b/docs/structure/exceptions.tsv@@ -31,7 +31,7 @@ SCAFFOLD_SEARCH library/ui/src/main/java/com/vayunmathur/library/ui/AppScaffold. SCAFFOLD_SEARCH library/ui/src/main/java/com/vayunmathur/library/ui/CommonSearchBar.kt <reason>` marker (sheet/drawer-local pickers). 1 SCAFFOLD_SEARCH photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.kt expandable SearchBar supplied as the AppScaffold topBar; its expanded overlay is the search-results photo grid 1 SCAFFOLD_SEARCH taxi/src/main/java/com/vayunmathur/taxi/ui/RideInputs.kt inline two-field origin/destination pair on the Ride booking screen (Route.Ride SiblingPage, not a DialogPage); ScaffoldSearch is a single top-bar field and cannot host both pickup and destination fields sharing one active-field suggestion list 1-SCAFFOLD_SEARCH weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.kt dialog-local location search inside a DialogPage route's Surface; no scaffold host 1+SCAFFOLD_SEARCH weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationContent.kt dialog-local location search inside a DialogPage route's Surface; no scaffold host 1 SCAFFOLD_SEARCH web/src/main/java/com/vayunmathur/web/ui/BrowserChrome.kt browser omnibox is navigation chrome, not screen search; the read-only address pill sits in the bespoke movable top/bottom browser toolbar, which has no AppScaffold search slot, and tapping it opens the omnibox editor overlay — the pill itself never edits or filters 1 SCAFFOLD_SEARCH web/src/main/java/com/vayunmathur/web/ui/BrowserOmniboxEditor.kt browser omnibox is navigation chrome, not screen search; the editable address field is anchored to its suggestions overlay and needs TextFieldValue selection control, Uri IME navigation submit and bottom docking, which the String-typed top-title ScaffoldSearch field cannot host 1 SCAFFOLD_SEARCH youpipe/src/main/java/com/vayunmathur/youpipe/ui/SearchScreen.kt expandable Material3 SearchBar whose expanded overlay is the search-results/suggestions surface (see the raw-scaffold exception below) 1@@ -75,6 +75,7 @@ SCREENSHOT_COVERAGE contacts/src/main/java/com/vayunmathur/contacts/Route.kt Imp SCREENSHOT_COVERAGE contacts/src/main/java/com/vayunmathur/contacts/Route.kt InsertOrEditContact: editor reads ViewModel + contacts-provider state; no stateless slice for Layoutlib 1 SCREENSHOT_COVERAGE contacts/src/main/java/com/vayunmathur/contacts/Route.kt RenameAccountDialog: dialog renames through the ViewModel account framework; no stateless slice 1 SCREENSHOT_COVERAGE contacts/src/main/java/com/vayunmathur/contacts/Route.kt Settings: settings page reads ViewModel account/provider flows; no stateless slice for Layoutlib 1+SCREENSHOT_COVERAGE education/src/main/java/com/vayunmathur/education/Route.kt VideoPlayer: streaming ExoPlayer surface needs a live network media session; Layoutlib cannot render playback 1 SCREENSHOT_COVERAGE health/src/main/java/com/vayunmathur/health/Route.kt AddIngredientDialog: dialog searches the bundled food database and remote API through the ViewModel; no stateless slice for Layoutlib 1 SCREENSHOT_COVERAGE health/src/main/java/com/vayunmathur/health/Route.kt CatalogPicker: picker searches MedicalViewModel catalog flows (CVX/RxNorm/LOINC) and writes the draft; no stateless slice for Layoutlib 1 SCREENSHOT_COVERAGE health/src/main/java/com/vayunmathur/health/Route.kt EditAllergy: form edits a MedicalViewModel draft loaded from Room/Health Connect; no stateless slice for Layoutlib 1@@ -95,4 +96,5 @@ SCREENSHOT_COVERAGE taxi/src/main/java/com/vayunmathur/taxi/Route.kt Accounts: s SCREENSHOT_COVERAGE taxi/src/main/java/com/vayunmathur/taxi/Route.kt CurrentRide: tab polls the Lyft provider for a live active ride and delegates to live tracking; no stateless slice for Layoutlib 1 SCREENSHOT_COVERAGE taxi/src/main/java/com/vayunmathur/taxi/Route.kt LyftSignIn: live phone/SMS sign-in with a per-session UUID and token-store persistence; no stateless slice for Layoutlib 1 SCREENSHOT_COVERAGE taxi/src/main/java/com/vayunmathur/taxi/Route.kt RideTracking: live ride screen polls status and driver location, renders the native map and starts the foreground tracking service; no stateless slice for Layoutlib 1+SCREENSHOT_COVERAGE weather/src/main/java/com/vayunmathur/weather/Route.kt WeatherMap: the map page draws through the native vector-map surface (library:map VectorMap), which Layoutlib cannot render, so no static capture can show it 1 TOAST share/src/main/java/com/vayunmathur/share/platform/receive/ShareSaveActivity.kt no UI to host a snackbar. 1
weather/AGENTS.md
diff --git a/weather/AGENTS.md b/weather/AGENTS.mdindex c7dbdfb429..45949082d7 100644--- a/weather/AGENTS.md+++ b/weather/AGENTS.md@@ -74,6 +74,7 @@ _Install: ./install weather (dev by default)._ - com/vayunmathur/weather/ui/DeviceLocation.kt - com/vayunmathur/weather/ui/LocationsScreen.kt - com/vayunmathur/weather/ui/SearchLocationPage.kt+- com/vayunmathur/weather/ui/SearchLocationContent.kt — stateless search-dialog body rendered by SearchLocationPage and screenshot captures - com/vayunmathur/weather/ui/WeatherMapPage.kt - com/vayunmathur/weather/ui/WeatherMapState.kt - com/vayunmathur/weather/ui/WeatherMapComponents.kt
weather/src/main/java/com/vayunmathur/weather/Route.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/Route.kt b/weather/src/main/java/com/vayunmathur/weather/Route.ktindex 094e50fb7d..1ca863c0f9 100644--- a/weather/src/main/java/com/vayunmathur/weather/Route.kt+++ b/weather/src/main/java/com/vayunmathur/weather/Route.kt@@ -3,6 +3,7 @@ package com.vayunmathur.weather import com.vayunmathur.library.util.NavKey import kotlinx.serialization.Serializable +// SCREENSHOT COVERAGE EXCEPTION: WeatherMap: the map page draws through the native vector-map surface (library:map VectorMap), which Layoutlib cannot render, so no static capture can show it /** Contract for route. */ @Serializable sealed interface Route : NavKey {
weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.ktindex eaf6f1f0a2..2d0349b274 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt@@ -1,15 +1,12 @@ package com.vayunmathur.weather.ui import androidx.compose.foundation.layout.Arrangement-import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding-import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width-import androidx.compose.ui.Alignment import com.vayunmathur.library.ui.R as UiR import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.ExperimentalMaterial3Api@@ -184,10 +181,10 @@ fun LocationsScreen( modifier = Modifier.shadow(elevation, MaterialTheme.shapes.extraLarge), dragHandle = if (localData.size > 1) { {- // Drag handle demoted from IconButton: not a- // button — draggableHandle owns the gesture.- Box(- modifier = Modifier.size(48.dp).draggableHandle(+ // Not a button: the reorder modifier owns the gesture, so the+ // grip is a plain container rather than a dead IconButton.+ androidx.compose.foundation.layout.Box(+ modifier = Modifier.draggableHandle( reorderState, key = loc.id, index = idx,@@ -198,7 +195,6 @@ fun LocationsScreen( haptics.performHapticFeedback(HapticFeedbackType.GestureEnd) }, ),- contentAlignment = Alignment.Center, ) { IconDragHandle(tint = MaterialTheme.colorScheme.onSurfaceVariant) }
weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationContent.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationContent.kt b/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationContent.ktnew file mode 100644index 0000000000..083ad952a7--- /dev/null+++ b/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationContent.kt@@ -0,0 +1,122 @@+package com.vayunmathur.weather.ui++// SCAFFOLD SEARCH EXCEPTION: dialog-local location search inside a DialogPage route's Surface; no scaffold host+import androidx.compose.foundation.clickable+import androidx.compose.foundation.layout.Box+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.Spacer+import androidx.compose.foundation.layout.fillMaxSize+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.height+import androidx.compose.foundation.layout.heightIn+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.lazy.LazyColumn+import androidx.compose.foundation.lazy.items+import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.res.stringResource+import androidx.compose.ui.unit.dp+import com.vayunmathur.library.ui.IconSearch+import com.vayunmathur.library.ui.ListItem+import com.vayunmathur.library.ui.ListItemDefaults+import com.vayunmathur.library.ui.MaterialTheme+import com.vayunmathur.library.ui.OutlinedTextField+import com.vayunmathur.library.ui.Surface+import com.vayunmathur.library.ui.Text+import com.vayunmathur.weather.R+import com.vayunmathur.weather.domain.TemperatureUnit+import com.vayunmathur.weather.domain.formatTemperatureCompact+import com.vayunmathur.weather.network.GeocodingResult++/**+ * Stateless search-location dialog body: the query field and its result+ * rows. Split from SearchLocationPage (which owns the debounced geocode+ * lookup and the add-location action) so screenshot captures can render+ * it with fixed results.+ */+@Composable+fun SearchLocationContent(+ query: String,+ onQueryChange: (String) -> Unit,+ results: List<GeocodingResult>,+ searching: Boolean,+ temps: Map<Long, Double?>,+ tempUnit: TemperatureUnit,+ onPick: (GeocodingResult) -> Unit,+) {+ Surface(+ shape = MaterialTheme.shapes.extraLarge,+ color = MaterialTheme.colorScheme.surfaceContainer,+ tonalElevation = 0.dp,+ ) {+ Column(+ modifier = Modifier+ .padding(16.dp)+ .heightIn(min = 220.dp, max = 480.dp),+ ) {+ Text(+ stringResource(R.string.search_location),+ style = MaterialTheme.typography.titleMedium,+ color = MaterialTheme.colorScheme.onSurface,+ )+ Spacer(Modifier.height(12.dp))+ OutlinedTextField(+ value = query,+ onValueChange = onQueryChange,+ placeholder = { Text(stringResource(R.string.city_name_hint)) },+ leadingIcon = { IconSearch() },+ singleLine = true,+ modifier = Modifier.fillMaxWidth(),+ )+ Spacer(Modifier.height(8.dp))+ Box(modifier = Modifier.fillMaxWidth().heightIn(min = 80.dp, max = 320.dp)) {+ when {+ searching && results.isEmpty() -> {+ Text("Loading…", modifier = Modifier.align(Alignment.Center))+ }+ query.isNotBlank() && results.isEmpty() && !searching -> {+ Text(+ stringResource(R.string.no_matches),+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ modifier = Modifier.align(Alignment.Center),+ )+ }+ else -> {+ LazyColumn(modifier = Modifier.fillMaxSize()) {+ items(results, key = { it.id }) { r ->+ ListItem(+ colors = ListItemDefaults.colors(+ containerColor = MaterialTheme.colorScheme.surfaceContainer,+ ),+ content = { Text(r.name) },+ supportingContent = {+ val parts = listOfNotNull(r.admin1, r.country).filter { it.isNotBlank() }+ if (parts.isNotEmpty()) Text(parts.joinToString(", "))+ },+ trailingContent = {+ if (temps.containsKey(r.id)) {+ temps[r.id]?.let { temp ->+ Text(+ formatTemperatureCompact(temp, tempUnit),+ style = MaterialTheme.typography.titleMedium,+ color = MaterialTheme.colorScheme.onSurface,+ )+ }+ } else {+ Text("Loading…")+ }+ },+ modifier = Modifier+ .fillMaxWidth()+ .padding(vertical = 2.dp)+ .clickable { onPick(r) },+ )+ }+ }+ }+ }+ }+ }+ }+}
weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.ktindex 7ce637758d..ef1a0cf5fb 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/SearchLocationPage.kt@@ -1,29 +1,11 @@ package com.vayunmathur.weather.ui -// SCAFFOLD SEARCH EXCEPTION: dialog-local location search inside a DialogPage route's Surface; no scaffold host import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.content.res.Resources import android.provider.Settings-import androidx.compose.foundation.clickable-import androidx.compose.foundation.layout.Arrangement-import androidx.compose.foundation.layout.Box-import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.Spacer-import androidx.compose.foundation.layout.fillMaxSize-import androidx.compose.foundation.layout.fillMaxWidth-import androidx.compose.foundation.layout.height-import androidx.compose.foundation.layout.heightIn-import androidx.compose.foundation.layout.padding-import androidx.compose.foundation.layout.size-import androidx.compose.foundation.lazy.LazyColumn-import androidx.compose.foundation.lazy.items import com.vayunmathur.library.ui.ExperimentalMaterial3Api-import com.vayunmathur.library.ui.ListItem-import com.vayunmathur.library.ui.ListItemDefaults-import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue@@ -31,14 +13,9 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow-import androidx.compose.ui.Alignment-import androidx.compose.ui.Modifier-import androidx.compose.ui.res.stringResource-import androidx.compose.ui.unit.dp import com.vayunmathur.library.util.NavBackStack import com.vayunmathur.weather.R import com.vayunmathur.weather.Route-import com.vayunmathur.weather.domain.formatTemperatureCompact import com.vayunmathur.weather.network.GeocodingResult import com.vayunmathur.weather.network.WeatherApi import com.vayunmathur.weather.platform.WeatherViewModel@@ -108,94 +85,26 @@ fun SearchLocationPage(backStack: NavBackStack<Route>, viewModel: WeatherViewMod } } - com.vayunmathur.library.ui.Surface(- shape = MaterialTheme.shapes.extraLarge,- color = MaterialTheme.colorScheme.surfaceContainer,- tonalElevation = 0.dp,- ) {- Column(- modifier = Modifier- .padding(16.dp)- .heightIn(min = 220.dp, max = 480.dp),- ) {- Text(- stringResource(R.string.search_location),- style = MaterialTheme.typography.titleMedium,- color = MaterialTheme.colorScheme.onSurface,- )- Spacer(Modifier.height(12.dp))- com.vayunmathur.library.ui.OutlinedTextField(- value = query,- onValueChange = { query = it },- placeholder = { Text(stringResource(R.string.city_name_hint)) },- leadingIcon = {- com.vayunmathur.library.ui.IconSearch()- },- singleLine = true,- modifier = Modifier.fillMaxWidth(),- )- Spacer(Modifier.height(8.dp))- Box(modifier = Modifier.fillMaxWidth().heightIn(min = 80.dp, max = 320.dp)) {- when {- searching && results.isEmpty() -> {- Text("Loading\u2026", modifier = Modifier.align(Alignment.Center))- }- query.isNotBlank() && results.isEmpty() && !searching -> {- Text(- stringResource(R.string.no_matches),- color = MaterialTheme.colorScheme.onSurfaceVariant,- modifier = Modifier.align(Alignment.Center),- )- }- else -> {- LazyColumn(modifier = Modifier.fillMaxSize()) {- items(results, key = { it.id }) { r ->- ListItem(- colors = ListItemDefaults.colors(- containerColor = MaterialTheme.colorScheme.surfaceContainer,- ),- content = { Text(r.name) },- supportingContent = {- val parts = listOfNotNull(r.admin1, r.country).filter { it.isNotBlank() }- if (parts.isNotEmpty()) Text(parts.joinToString(", "))- },- trailingContent = {- if (temps.containsKey(r.id)) {- temps[r.id]?.let { temp ->- Text(- formatTemperatureCompact(temp, tempUnit),- style = MaterialTheme.typography.titleMedium,- color = MaterialTheme.colorScheme.onSurface,- )- }- } else {- Text("Loading\u2026")- }- },- modifier = Modifier- .fillMaxWidth()- .padding(vertical = 2.dp)- .clickable {- viewModel.addLocation(- name = r.name,- country = r.country.orEmpty(),- latitude = r.latitude,- longitude = r.longitude,- ) { newId ->- // Select the added location in the- // stack itself (replaces this dialog- // entry and any default Home beneath).- backStack.reset(Route.Home(newId))- }- },- )- }- }- }- }+ SearchLocationContent(+ query = query,+ onQueryChange = { query = it },+ results = results,+ searching = searching,+ temps = temps,+ tempUnit = tempUnit,+ onPick = { r ->+ viewModel.addLocation(+ name = r.name,+ country = r.country.orEmpty(),+ latitude = r.latitude,+ longitude = r.longitude,+ ) { newId ->+ // Select the added location in the stack itself (replaces this dialog+ // entry and any default Home beneath).+ backStack.reset(Route.Home(newId)) }- }- }+ },+ ) } /**
weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt
diff --git a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.ktindex b95b981739..6d057d0f20 100644--- a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt+++ b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt@@ -421,6 +421,51 @@ class MetadataPreviews { } } + @PreviewTest+ @Preview(name = "5-home", device = PHONE, group = "phone", showSystemUi = true)+ @Composable+ fun Preview5Home() {+ DynamicTheme(darkTheme = true) {+ HomeScreen(+ state = LocationUiState(+ location = LONDON,+ forecast = SAMPLE_FORECAST,+ airQuality = SAMPLE_AIR_QUALITY,+ ),+ units = DisplayUnits(),+ actions = WeatherActions.Noop,+ precipitationNowcast = stringResource(R.string.precip_no_rain_next_2h),+ nowEpochSec = NOW_EPOCH_SEC,+ )+ }+ }++ @PreviewTest+ @Preview(name = "6-search-location", device = PHONE, group = "phone", showSystemUi = true)+ @Composable+ fun Preview6SearchLocation() {+ DynamicTheme(darkTheme = true) {+ SearchLocationContent(+ query = "Lon",+ onQueryChange = {},+ results = listOf(+ com.vayunmathur.weather.network.GeocodingResult(+ id = 1, name = "London", latitude = 51.5072, longitude = -0.1276,+ country = "United Kingdom", admin1 = "England",+ ),+ com.vayunmathur.weather.network.GeocodingResult(+ id = 2, name = "Long Beach", latitude = 33.7701, longitude = -118.1937,+ country = "United States", admin1 = "California",+ ),+ ),+ searching = false,+ temps = mapOf(1L to 21.9, 2L to 24.4),+ tempUnit = com.vayunmathur.weather.domain.TemperatureUnit.Celsius,+ onPick = {},+ )+ }+ }+ @PreviewTest @Preview(name = "4-expanded", device = EXPANDED, group = "large-tablet", showSystemUi = true) @Composable
weather/src/test/java/com/vayunmathur/weather/platform/LocationProviderTest.kt
diff --git a/weather/src/test/java/com/vayunmathur/weather/platform/LocationProviderTest.kt b/weather/src/test/java/com/vayunmathur/weather/platform/LocationProviderTest.ktindex e8dc91bf68..fbcbf6f065 100644--- a/weather/src/test/java/com/vayunmathur/weather/platform/LocationProviderTest.kt+++ b/weather/src/test/java/com/vayunmathur/weather/platform/LocationProviderTest.kt@@ -20,6 +20,9 @@ import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue +/** Fixed location-fix stamp (2026-07-15T13:00Z) for deterministic fixtures. */+private const val FIXED_FIX_TIME_MS = 1_784_118_000_000L+ @RunWith(AndroidJUnit4::class) class LocationProviderTest { @@ -38,7 +41,9 @@ class LocationProviderTest { } private fun fix(lat: Double, provider: String = LocationManager.GPS_PROVIDER) = Location(provider).apply {- latitude = lat; longitude = 13.0; time = System.currentTimeMillis()+ // Fixed stamp: LocationProvider only orders fixes by time (maxBy), it never+ // compares against the wall clock, so a named constant is deterministic.+ latitude = lat; longitude = 13.0; time = FIXED_FIX_TIME_MS } @Test fun permissionGranted() {
weather/src/test/java/com/vayunmathur/weather/platform/PlatformHelpersTest.kt
diff --git a/weather/src/test/java/com/vayunmathur/weather/platform/PlatformHelpersTest.kt b/weather/src/test/java/com/vayunmathur/weather/platform/PlatformHelpersTest.ktindex 84344c78d5..b3aa8f89e5 100644--- a/weather/src/test/java/com/vayunmathur/weather/platform/PlatformHelpersTest.kt+++ b/weather/src/test/java/com/vayunmathur/weather/platform/PlatformHelpersTest.kt@@ -1,7 +1,6 @@ package com.vayunmathur.weather.platform -// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch.-+// FIXTURE RELATIVE-TIME EXCEPTION: precipitationNowcast reads the real clock internally, so its test series must be seeded relative to now or every slot falls outside its 2h horizon import android.content.Context import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4
weather/src/test/java/com/vayunmathur/weather/platform/ViewModelFetchTest.kt
diff --git a/weather/src/test/java/com/vayunmathur/weather/platform/ViewModelFetchTest.kt b/weather/src/test/java/com/vayunmathur/weather/platform/ViewModelFetchTest.ktindex 4c3db19aaa..e98c9b34f3 100644--- a/weather/src/test/java/com/vayunmathur/weather/platform/ViewModelFetchTest.kt+++ b/weather/src/test/java/com/vayunmathur/weather/platform/ViewModelFetchTest.kt@@ -1,7 +1,6 @@ package com.vayunmathur.weather.platform -// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch.-+// FIXTURE RELATIVE-TIME EXCEPTION: the ViewModel judges cache freshness and device fixes against the real clock, so fetchedAt and fix stamps must be seeded relative to now or fresh data reads as stale import android.app.Application import android.os.Looper import androidx.test.core.app.ApplicationProvider