From f1eeaddf84ba13b610d1dbfc7b6d4954c33e4d8f Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Wed, 4 Dec 2024 15:39:34 +0100 Subject: [PATCH] fix UI test --- .../CustomerCenter/CustomerCenterViewModelTests.swift | 2 +- .../CustomerCenter/MockCustomerCenterPurchases.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/RevenueCatUITests/CustomerCenter/CustomerCenterViewModelTests.swift b/Tests/RevenueCatUITests/CustomerCenter/CustomerCenterViewModelTests.swift index 9543aa54b1..997740bfa6 100644 --- a/Tests/RevenueCatUITests/CustomerCenter/CustomerCenterViewModelTests.swift +++ b/Tests/RevenueCatUITests/CustomerCenter/CustomerCenterViewModelTests.swift @@ -207,7 +207,7 @@ class CustomerCenterViewModelTests: TestCase { viewModel.trackImpression(darkMode: darkMode, displayMode: displayMode) expect(mockPurchases.trackedEvents.count) == 1 - let trackedEvent = try XCTUnwrap(mockPurchases.trackedEvents.first) + let trackedEvent = try XCTUnwrap(mockPurchases.trackedEvents.first as? CustomerCenterEvent) expect(trackedEvent.data.darkMode) == darkMode expect(trackedEvent.data.displayMode) == displayMode diff --git a/Tests/RevenueCatUITests/CustomerCenter/MockCustomerCenterPurchases.swift b/Tests/RevenueCatUITests/CustomerCenter/MockCustomerCenterPurchases.swift index 74be986619..4534f14651 100644 --- a/Tests/RevenueCatUITests/CustomerCenter/MockCustomerCenterPurchases.swift +++ b/Tests/RevenueCatUITests/CustomerCenter/MockCustomerCenterPurchases.swift @@ -55,8 +55,8 @@ final class MockCustomerCenterPurchases: @unchecked Sendable, CustomerCenterPurc var trackCallCount = 0 var trackError: Error? - var trackedEvents: [CustomerCenterEvent] = [] - func track(customerCenterEvent: CustomerCenterEvent) { + var trackedEvents: [CustomerCenterEventType] = [] + func track(customerCenterEvent: any CustomerCenterEventType) { trackCallCount += 1 trackedEvents.append(customerCenterEvent) }