Skip to content

Commit

Permalink
Merge pull request #974 from DeluxeAlonso/feature/code-cleanup
Browse files Browse the repository at this point in the history
Feature/code cleanup
  • Loading branch information
DeluxeAlonso committed Sep 14, 2024
2 parents f0bcecd + 035a95e commit 8c0d96e
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,29 @@ final class SearchOptionsDataSourceTests: XCTestCase {
XCTAssertEqual(numberOfSections, 2)
}

func testTitleForHeaderInSectionPopulatedState() {
// Arrange
viewModel.viewState = .init(.populatedMovieVisits)
// Act
let title = dataSource.tableView(UITableView(), titleForHeaderInSection: 0)
// Assert
XCTAssertEqual(title, "Recently visited")
}

func testTitleForHeaderInSectionEmptyState() {
// Arrange
viewModel.viewState = .init(.emptyMovieVisits)
// Act
let title = dataSource.tableView(UITableView(), titleForHeaderInSection: 0)
// Assert
XCTAssertNil(title)
}

func testDidSelectMovie() {
// Act
dataSource.recentlyVisitedMoviesTableViewCell(RecentlyVisitedMoviesTableViewCell(), didSelectMovieAt: IndexPath(row: 0, section: 0))
// Assert
XCTAssertEqual(viewModel.getRecentlyVisitedMovieSelectionCallCount, 1)
}

}

0 comments on commit 8c0d96e

Please sign in to comment.