Fix add button. Fix hotkeys in settings. Add Workspace hotkeys
This commit is contained in:
@@ -74,6 +74,30 @@ final class WorkspaceRegistryTests: XCTestCase {
|
||||
XCTAssertEqual(store.savedSummaries.map(\.name), ["Main"])
|
||||
}
|
||||
|
||||
func testUpdateWorkspaceHotkeyPersistsAndUpdatesSummary() {
|
||||
let store = InMemoryWorkspaceStore()
|
||||
let registry = makeRegistry(store: store)
|
||||
let docsID = registry.createWorkspace(named: "Docs")
|
||||
let hotkey = HotkeyBinding.cmdShiftDigit(4)
|
||||
|
||||
registry.updateWorkspaceHotkey(id: docsID, to: hotkey)
|
||||
|
||||
XCTAssertEqual(registry.summary(for: docsID)?.hotkey, hotkey)
|
||||
XCTAssertEqual(store.savedSummaries.last?.hotkey, hotkey)
|
||||
}
|
||||
|
||||
func testNextAndPreviousWorkspaceWrapAroundRegistryOrder() {
|
||||
let registry = makeRegistry()
|
||||
let mainID = registry.defaultWorkspaceID
|
||||
let docsID = registry.createWorkspace(named: "Docs")
|
||||
let reviewID = registry.createWorkspace(named: "Review")
|
||||
|
||||
XCTAssertEqual(registry.nextWorkspaceID(after: mainID), docsID)
|
||||
XCTAssertEqual(registry.nextWorkspaceID(after: reviewID), mainID)
|
||||
XCTAssertEqual(registry.previousWorkspaceID(before: mainID), reviewID)
|
||||
XCTAssertEqual(registry.previousWorkspaceID(before: docsID), mainID)
|
||||
}
|
||||
|
||||
private func makeRegistry(
|
||||
initialWorkspaces: [WorkspaceSummary]? = [],
|
||||
store: (any WorkspaceStoreType)? = nil
|
||||
|
||||
Reference in New Issue
Block a user