Skip to content

Commit

Permalink
Fix SwiftSnapshotTest errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahkeen committed Jan 17, 2025
1 parent f1351c0 commit aff521d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ios/HackerNews.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 62J2XHNK9T;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.emerge.hn.Hacker-NewsTests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -908,7 +908,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 62J2XHNK9T;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.4;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.emerge.hn.Hacker-NewsTests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -928,6 +928,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 62J2XHNK9T;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.emerge.hn.Hacker-NewsUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -946,6 +947,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 62J2XHNK9T;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.emerge.hn.Hacker-NewsUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
8 changes: 4 additions & 4 deletions ios/HackerNewsTests/SwiftSnapshotTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class SwiftSnapshotTest: XCTestCase {

@MainActor override func setUp() {
super.setUp()
appViewModel = AppViewModel()
appViewModel = AppViewModel(bookmarkStore: FakeBookmarkDataStore())
}

override func tearDown() {
Expand All @@ -37,16 +37,16 @@ final class SwiftSnapshotTest: XCTestCase {
let defaultView = FeedScreen(model: appViewModel)

// Test loading state
let loadingViewModel = AppViewModel()
let loadingViewModel = AppViewModel(bookmarkStore: FakeBookmarkDataStore())
loadingViewModel.feedState = FeedState(
stories: []
)
let loadingView = FeedScreen(model: loadingViewModel)

// Test loaded state with posts
let loadedViewModel = AppViewModel()
let loadedViewModel = AppViewModel(bookmarkStore: FakeBookmarkDataStore())
loadedViewModel.feedState = FeedState(
stories: PreviewHelpers.makeFakeStories().map { StoryState.loaded(story: $0) }
stories: PreviewHelpers.makeFakeStories().map { StoryState.loaded(content: $0.toStoryContent()) }
)
let loadedView = FeedScreen(model: loadedViewModel)

Expand Down

0 comments on commit aff521d

Please sign in to comment.