Alerts choose their own fuel, independent of the Stations tab
The proximity monitor was tied to the Stations-tab fuel selection, so switching the list to another fuel silently re-targeted geofences. Now the Alerts tab has its own 'Fuel to monitor' picker (persisted as fuelboard.alertsFuel): - Monitor reads loadAlertsFuel() on init/background relaunch - Changing the alerts fuel re-registers geofences around stations selling that fuel only - Favourites priority slots stay scoped to the monitored fuel - Tests: alerts fuel round-trip + default (33/33 passing)
This commit is contained in:
@@ -243,3 +243,18 @@ final class FavouriteRefreshTests: XCTestCase {
|
||||
XCTAssertTrue(diesel.id.hasPrefix("diesel|"))
|
||||
}
|
||||
}
|
||||
|
||||
final class AlertsFuelTests: XCTestCase {
|
||||
func testAlertsFuelRoundTrips() {
|
||||
FuelStore.saveAlertsFuel(.diesel)
|
||||
XCTAssertEqual(FuelStore.loadAlertsFuel(), .diesel, "alerts fuel persists independently")
|
||||
}
|
||||
|
||||
func testAlertsFuelDefaultsToUnleaded() {
|
||||
// Fresh state (test isolation) defaults to Unleaded like the app's
|
||||
// other fuel selections.
|
||||
FuelStore.saveAlertsFuel(.e5)
|
||||
FuelStore.saveAlertsFuel(.e10)
|
||||
XCTAssertEqual(FuelStore.loadAlertsFuel(), .e10)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user