diff --git a/Packages/CandidateUI/Tests/CandidateUITests/HorizontalCandidateControllerTests.swift b/Packages/CandidateUI/Tests/CandidateUITests/HorizontalCandidateControllerTests.swift index efb43533..96f344cb 100644 --- a/Packages/CandidateUI/Tests/CandidateUITests/HorizontalCandidateControllerTests.swift +++ b/Packages/CandidateUI/Tests/CandidateUITests/HorizontalCandidateControllerTests.swift @@ -24,7 +24,9 @@ class HorizontalCandidateControllerTests: XCTestCase { let controller = HorizontalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() controller.visible = true controller.set(windowTopLeftPoint: NSPoint(x: -100, y: 0), bottomOutOfScreenAdjustmentHeight: 10) @@ -37,7 +39,9 @@ class HorizontalCandidateControllerTests: XCTestCase { let controller = HorizontalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() controller.visible = true let screenRect = NSScreen.main?.frame ?? NSRect.zero @@ -52,7 +56,9 @@ class HorizontalCandidateControllerTests: XCTestCase { let controller = HorizontalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() XCTAssert(controller.selectedCandidateIndex == 0) } @@ -60,7 +66,9 @@ class HorizontalCandidateControllerTests: XCTestCase { func testHighlightNextCandidate() { let controller = HorizontalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock var result = controller.highlightNextCandidate() XCTAssert(result == true) @@ -91,7 +99,9 @@ class HorizontalCandidateControllerTests: XCTestCase { func testHighlightPreviousCandidate() { let controller = HorizontalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock _ = controller.showNextPage() XCTAssert(controller.selectedCandidateIndex == 4) @@ -115,7 +125,9 @@ class HorizontalCandidateControllerTests: XCTestCase { func testShowNextPage() { let controller = HorizontalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } _ = controller.delegate = mock var result = controller.showNextPage() XCTAssert(result == true) @@ -128,7 +140,9 @@ class HorizontalCandidateControllerTests: XCTestCase { func testShowPreviousPage() { let controller = HorizontalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock _ = controller.showNextPage() var result = controller.showPreviousPage() diff --git a/Packages/CandidateUI/Tests/CandidateUITests/VerticalCandidateControllerTests.swift b/Packages/CandidateUI/Tests/CandidateUITests/VerticalCandidateControllerTests.swift index b5b00c6c..0d30053e 100644 --- a/Packages/CandidateUI/Tests/CandidateUITests/VerticalCandidateControllerTests.swift +++ b/Packages/CandidateUI/Tests/CandidateUITests/VerticalCandidateControllerTests.swift @@ -24,7 +24,9 @@ class VerticalCandidateControllerTests: XCTestCase { let controller = HorizontalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() controller.visible = true controller.set(windowTopLeftPoint: NSPoint(x: -100, y: 0), bottomOutOfScreenAdjustmentHeight: 10) @@ -37,7 +39,9 @@ class VerticalCandidateControllerTests: XCTestCase { let controller = HorizontalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() controller.visible = true let screenRect = NSScreen.main?.frame ?? NSRect.zero @@ -52,7 +56,9 @@ class VerticalCandidateControllerTests: XCTestCase { let controller = VerticalCandidateController() let mock = Mock() controller.delegate = mock - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.reloadData() XCTAssert(controller.selectedCandidateIndex == 0) } @@ -60,7 +66,9 @@ class VerticalCandidateControllerTests: XCTestCase { func testHighlightNextCandidate() { let controller = VerticalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock controller.reloadData() var result = controller.highlightNextCandidate() @@ -92,7 +100,9 @@ class VerticalCandidateControllerTests: XCTestCase { func testHighlightPreviousCandidate() { let controller = VerticalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock _ = controller.showNextPage() XCTAssert(controller.selectedCandidateIndex == 4) @@ -116,7 +126,9 @@ class VerticalCandidateControllerTests: XCTestCase { func testShowNextPage() { let controller = VerticalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } _ = controller.delegate = mock var result = controller.showNextPage() XCTAssert(result == true) @@ -132,7 +144,9 @@ class VerticalCandidateControllerTests: XCTestCase { func testShowPreviousPage() { let controller = VerticalCandidateController() let mock = Mock() - controller.keyLabels = ["1", "2", "3", "4"] + controller.keyLabels = ["1", "2", "3", "4"].map { + CandidateKeyLabel(key: $0, displayedText: $0) + } controller.delegate = mock _ = controller.showNextPage() var result = controller.showPreviousPage()