Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Rodriguez authored and Brandon Rodriguez committed Nov 12, 2024
1 parent 2426180 commit eca1134
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ struct ContentView: View {
.frame(maxWidth: proxy.size.width, maxHeight: proxy.size.height)
.clipped()
}
.tag("empty-map-grid")
}
}

Expand Down
11 changes: 10 additions & 1 deletion iosApp/iosAppTests/Views/ContentViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,20 @@ final class ContentViewTests: XCTestCase {
}

func testShowsMap() throws {
let sut = withDefaultEnvironmentObjects(sut: ContentView(contentVM: FakeContentVM()))
let fakeVM = FakeContentVM()
fakeVM.configResponse = ApiResultOk(data: .init(mapboxPublicToken: "FAKE_TOKEN"))
let sut = withDefaultEnvironmentObjects(sut: ContentView(contentVM: fakeVM))

XCTAssertNotNil(try sut.inspect().find(HomeMapView.self))
}

func testShowsMapLoading() throws {
let fakeVM = FakeContentVM()
let sut = withDefaultEnvironmentObjects(sut: ContentView(contentVM: fakeVM))

XCTAssertNotNil(try sut.inspect().find(viewWithTag: "empty-map-grid"))
}

func testShowsOnboarding() throws {
let contentVM = ContentViewModel(onboardingScreensPending: [.feedback])
let sut = withDefaultEnvironmentObjects(sut: ContentView(contentVM: contentVM))
Expand Down

0 comments on commit eca1134

Please sign in to comment.