restores Helder in all its glory

This commit is contained in:
2026-09-28 11:34:49 +02:00
parent c2b38b853c
commit 1d29d0952d
280 changed files with 29205 additions and 7 deletions
@@ -0,0 +1,37 @@
import HelderCore
@testable import HelderUI
import Testing
@Suite struct LauncherListTests {
private let recents = [
RecentProject(path: "/code/a", name: "a"),
RecentProject(path: "/code/b", name: "b"),
]
@Test func theFirstRowOpensTheFolderPicker() {
let list = LauncherList(recents: recents)
#expect(list.count == 3)
#expect(list.selectedChoice == .chooseFolder)
}
@Test func arrowsMoveThroughTheRowsAndStopAtTheEnds() {
var list = LauncherList(recents: recents)
list.move(by: -1)
#expect(list.selection == 0)
list.move(by: 1)
#expect(list.selectedChoice == .open(path: "/code/a"))
list.move(by: 5)
#expect(list.selectedChoice == .open(path: "/code/b"))
}
@Test func theOpenProjectIsNotOfferedAgain() {
let list = LauncherList(recents: recents, excluding: "/code/a")
#expect(list.recents.map(\.path) == ["/code/b"])
}
@Test func hoverSelectionIsClamped() {
var list = LauncherList(recents: recents)
list.select(99)
#expect(list.selection == 2)
}
}