From 9ec310e784fc6ec181a1331cf2c7d680fe201c0a Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 18 Dec 2024 18:14:13 +0000 Subject: [PATCH] Fix unit tests. --- UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift b/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift index 56cc8ed1a4..c130d43c1e 100644 --- a/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift +++ b/UnitTests/Sources/TimelineMediaPreviewViewModelTests.swift @@ -104,7 +104,6 @@ class TimelineMediaPreviewViewModelTests: XCTestCase { XCTAssertEqual(viewModel.state.currentItem.contentType, "JPEG image") // When choosing to save the image. - let item = context.viewState.currentItem let deferred = deferFulfillment(context.$viewState) { $0.bindings.alertInfo != nil } context.send(viewAction: .saveCurrentItem) try await deferred.fulfill() @@ -164,7 +163,7 @@ class TimelineMediaPreviewViewModelTests: XCTestCase { private func loadInitialItem() async throws { let deferred = deferFulfillment(viewModel.state.fileLoadedPublisher) { _ in true } - context.send(viewAction: .updateCurrentItem(context.viewState.previewItems[0])) + context.send(viewAction: .updateCurrentItem(context.viewState.previewItems[context.viewState.initialItemIndex])) try await deferred.fulfill() }