Settings: price display toggle — station sign (£129.9) vs pounds & pence (£1.299); display-only, all surfaces (list, widgets, Live Activity, Siri cards); Siri dialog stays speech-safe pounds
This commit is contained in:
@@ -561,3 +561,26 @@ final class SiriCheapestLookupTests: XCTestCase {
|
||||
XCTAssertTrue(label.hasPrefix("as of "), "plain ISO 8601 still parses")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Price display style
|
||||
|
||||
final class PriceDisplayTests: XCTestCase {
|
||||
func testStationSignStyle() {
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .stationSign), "£129.9")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .stationSign), "£135.0")
|
||||
XCTAssertEqual(FuelStore.priceText(249.9, style: .stationSign), "£249.9")
|
||||
}
|
||||
|
||||
func testPoundsPenceStyle() {
|
||||
XCTAssertEqual(FuelStore.priceText(129.9, style: .poundsPence), "£1.299")
|
||||
XCTAssertEqual(FuelStore.priceText(135.0, style: .poundsPence), "£1.350")
|
||||
XCTAssertEqual(FuelStore.priceText(100.9, style: .poundsPence), "£1.009")
|
||||
}
|
||||
|
||||
func testSpokenAlwaysPounds() {
|
||||
// Siri would read "£129.9" as "one hundred and twenty-nine pounds" —
|
||||
// the spoken form must always be pounds regardless of display style.
|
||||
XCTAssertEqual(FuelStore.priceTextSpoken(129.9), "£1.299")
|
||||
XCTAssertEqual(FuelStore.priceTextSpoken(100.9), "£1.009")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user