Skip to content

Commit

Permalink
Fixed tests pre-iOS 17
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Feb 5, 2024
1 parent d15eb9b commit a9589ff
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions Tests/UnitTests/Paywalls/PaywallDataTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,25 @@ class PaywallDataTests: BaseHTTPResponseTest {
expect(enConfig.title) == "Paywall"
}

func testLocalesOrderedByPriority() {
expect(PaywallData.localesOrderedByPriority.map(\.identifier)) == [
"en_US",
"en-US",
"en"
]
func testLocalesOrderedByPriority() throws {
let expected: [String]

if #available(iOS 17.0, tvOS 17, watchOS 10, *) {
expected = [
"en_US",
"en-US",
"en"
]
} else {
expected = [
"en_US",
// `Locale.preferredLanguages` returns `en` before iOS 17.
"en",
"en"
]
}

expect(PaywallData.localesOrderedByPriority.map(\.identifier)) == expected
}

func testDoesNotFindLocaleWithMissingLanguage() throws {
Expand Down

0 comments on commit a9589ff

Please sign in to comment.