Skip to content

Commit

Permalink
Fix test check for locale
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Jul 9, 2024
1 parent 8a1313f commit e0b4ea4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RevenueCatUI/CustomerCenter/Views/CustomerCenterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private extension CustomerCenterView {
func destinationView(configuration: CustomerCenterConfigData) -> some View {
if viewModel.hasSubscriptions {
if viewModel.subscriptionsAreFromApple,
let screen = configuration[.management] {
let screen = configuration.screens[.management] {
ManageSubscriptionsView(screen: screen)
} else {
WrongPlatformView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct ManageSubscriptionsView_Previews: PreviewProvider {

static var previews: some View {
let viewModel = ManageSubscriptionsViewModel(
screen: CustomerCenterConfigTestData.customerCenterData[.management]!,
screen: CustomerCenterConfigTestData.customerCenterData.screens[.management]!,
subscriptionInformation: CustomerCenterConfigTestData.subscriptionInformation)
ManageSubscriptionsView(viewModel: viewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ final class MockManageSubscriptionsPurchases: ManageSubscriptionsPurchaseType {
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
private extension ManageSubscriptionsViewModelTests {

static let screen: CustomerCenterConfigData.Screen = CustomerCenterConfigTestData.customerCenterData[.management]!
static let screen: CustomerCenterConfigData.Screen =
CustomerCenterConfigTestData.customerCenterData.screens[.management]!

static func createMockProduct() -> StoreProduct {
// Using SK1 products because they can be mocked, but CustomerCenterViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BackendGetCustomerCenterConfigTests: BaseBackendTests {

expect(result).to(beSuccess())
expect(self.httpClient.calls).to(haveCount(1))
expect(self.httpClient.calls[0].headers["X-Supported-Locales"]) == "en_EN,es_ES"
expect(self.httpClient.calls[0].headers["X-Preferred-Locales"]) == "en_EN,es_ES"
}

func testGetCustomerCenterConfigCallsHTTPMethodWithRandomDelay() {
Expand Down

0 comments on commit e0b4ea4

Please sign in to comment.