Skip to content

Commit

Permalink
fix(sortby): properly map indices names (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab authored Nov 19, 2024
1 parent 6d1a3ae commit a4cdf26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class SortByConnector {
selected: Int? = nil) {
let enumeratedIndices = indicesNames
.indices
.map { ($0, indicesNames[0]) }
.map { ($0, indicesNames[$0]) }
let items = [Int: IndexName](uniqueKeysWithValues: enumeratedIndices)
let interactor = SortByInteractor(items: items)
interactor.selected = selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class SortByConnectorTests: XCTestCase {
controller: controller)
}

func testInitialIndicesNames() {
XCTAssertEqual(connector.indicesNames, ["Index1", "Index2", "Index3"])
}

func testSetItemsInteractorToController() {
let itemsChangedExpectation = expectation(description: "Items changed")
controller.onItemsChanged = {
Expand Down

0 comments on commit a4cdf26

Please sign in to comment.