Skip to content

Commit 5fd2b5b

Browse files
committed
Fix test build failures from missing country code in unsupportedCurrency case.
1 parent 9a0ccf9 commit 5fd2b5b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

WooCommerce/WooCommerceTests/POS/ViewHelpers/PointOfSaleDashboardViewHelperTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct PointOfSaleDashboardViewHelperTests {
6767
@Test(arguments: [
6868
POSIneligibleReason.unsupportedIOSVersion,
6969
POSIneligibleReason.unsupportedWooCommerceVersion(minimumVersion: "9.6.0"),
70-
POSIneligibleReason.unsupportedCurrency(supportedCurrencies: [.USD, .GBP]),
70+
POSIneligibleReason.unsupportedCurrency(countryCode: .US, supportedCurrencies: [.USD, .GBP]),
7171
POSIneligibleReason.siteSettingsNotAvailable,
7272
POSIneligibleReason.wooCommercePluginNotFound,
7373
POSIneligibleReason.featureSwitchDisabled,

WooCommerce/WooCommerceTests/ViewRelated/Settings/POS/POSTabEligibilityCheckerTests.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ struct POSTabEligibilityCheckerTests {
451451
let result = await checker.checkEligibility()
452452

453453
// Then
454-
#expect(result == .ineligible(reason: .unsupportedCurrency(supportedCurrencies: expectedSupportedCurrencies)))
454+
#expect(result == .ineligible(reason: .unsupportedCurrency(countryCode: country.countryCode, supportedCurrencies: expectedSupportedCurrencies)))
455455
}
456456

457457
func is_ineligible_when_woocommerce_version_is_below_minimum() async throws {
@@ -551,7 +551,7 @@ struct POSTabEligibilityCheckerTests {
551551

552552
@Test(arguments: [
553553
POSIneligibleReason.siteSettingsNotAvailable,
554-
POSIneligibleReason.unsupportedCurrency(supportedCurrencies: [.USD])
554+
POSIneligibleReason.unsupportedCurrency(countryCode: .US, supportedCurrencies: [.USD])
555555
])
556556
fileprivate func refreshEligibility_syncs_site_settings_and_checks_eligibility_for_site_settings_issues(ineligibleReason: POSIneligibleReason) async throws {
557557
// Given
@@ -586,7 +586,7 @@ struct POSTabEligibilityCheckerTests {
586586

587587
@Test(arguments: [
588588
POSIneligibleReason.siteSettingsNotAvailable,
589-
POSIneligibleReason.unsupportedCurrency(supportedCurrencies: [.USD])
589+
POSIneligibleReason.unsupportedCurrency(countryCode: .US, supportedCurrencies: [.USD])
590590
])
591591
fileprivate func refreshEligibility_returns_siteSettingsNotAvailable_when_site_settings_sync_fails(ineligibleReason: POSIneligibleReason) async throws {
592592
// Given
@@ -828,6 +828,19 @@ private extension POSTabEligibilityCheckerTests {
828828
case ca = "CA:NS"
829829
case gb = "GB"
830830
case es = "ES"
831+
832+
var countryCode: CountryCode {
833+
switch self {
834+
case .us:
835+
return .US
836+
case .ca:
837+
return .CA
838+
case .gb:
839+
return .GB
840+
case .es:
841+
return .ES
842+
}
843+
}
831844
}
832845

833846
func mockCountrySetting(country: Country, siteID: Int64? = nil) -> SiteSetting {

0 commit comments

Comments
 (0)