Fix tests broken by buffers !56

merged merged by cmc on 2026-10-06 00:00 UTC · krz/orgstar:fix-tests into main

2 files changed, +9 −9

Layout: unified · split

Tests/OrgAppTests/AppTests.swift +6 −6
@@ -313,21 +313,21 @@ struct AgendaModelTests {
313 utc.timeZone = TimeZone(identifier: "UTC")! 313 utc.timeZone = TimeZone(identifier: "UTC")!
314 let now = try #require(utc.date(from: DateComponents(year: 2026, month: 10, day: 5, hour: 9))) 314 let now = try #require(utc.date(from: DateComponents(year: 2026, month: 10, day: 5, hour: 9)))
315 315
316 await agenda.refresh(open: nil, now: now, calendar: utc) 316 await agenda.refresh(open: [:], now: now, calendar: utc)
317 #expect(agenda.days.count == 10) 317 #expect(agenda.days.count == 10)
318 #expect(agenda.days[3].isToday) 318 #expect(agenda.days[3].isToday)
319 #expect(agenda.days[3].items.map(\.text) == ["TODO Pay rent"]) 319 #expect(agenda.days[3].items.map(\.text) == ["TODO Pay rent"])
320 320
321 agenda.includeSubfolders = true 321 agenda.includeSubfolders = true
322 await agenda.refresh(open: nil, now: now, calendar: utc) 322 await agenda.refresh(open: [:], now: now, calendar: utc)
323 #expect(agenda.days[3].items.map(\.text) == ["TODO Pay rent", "Hidden "]) 323 #expect(agenda.days[3].items.map(\.text) == ["TODO Pay rent", "Hidden "])
324 324
325 let path = try #require(agenda.files.first { $0.hasSuffix("/a.org") }) 325 let path = try #require(agenda.files.first { $0.hasSuffix("/a.org") })
326 await agenda.refresh(open: (path, "* DONE Pay rent\nSCHEDULED: <2026-10-05 Mon>\n"), now: now, calendar: utc) 326 await agenda.refresh(open: [path: "* DONE Pay rent\nSCHEDULED: <2026-10-05 Mon>\n"], now: now, calendar: utc)
327 #expect(agenda.days[3].items.first?.text == "DONE Pay rent") 327 #expect(agenda.days[3].items.first?.text == "DONE Pay rent")
328 328
329 agenda.shift(forward: true, now: now, calendar: utc) 329 agenda.shift(forward: true, now: now, calendar: utc)
330 await agenda.refresh(open: nil, now: now, calendar: utc) 330 await agenda.refresh(open: [:], now: now, calendar: utc)
331 #expect(agenda.days.first?.day == Days.absolute(year: 2026, month: 10, day: 12)) 331 #expect(agenda.days.first?.day == Days.absolute(year: 2026, month: 10, day: 12))
332 } 332 }
333} 333}
@@ -368,10 +368,10 @@ struct AgendaCommandTests {
368 try await model.addRoot(notes.url) 368 try await model.addRoot(notes.url)
369 let agenda = AgendaModel(workspace: model) 369 let agenda = AgendaModel(workspace: model)
370 agenda.mode = .todo(keywords: nil) 370 agenda.mode = .todo(keywords: nil)
371 await agenda.refresh(open: nil) 371 await agenda.refresh(open: [:])
372 #expect(agenda.list.map(\.text) == ["TODO One", "TODO Three"]) 372 #expect(agenda.list.map(\.text) == ["TODO One", "TODO Three"])
373 agenda.mode = .match("work", todoOnly: false) 373 agenda.mode = .match("work", todoOnly: false)
374 await agenda.refresh(open: nil) 374 await agenda.refresh(open: [:])
375 #expect(agenda.list.map(\.text) == ["TODO One"]) 375 #expect(agenda.list.map(\.text) == ["TODO One"])
376 } 376 }
377 377
Tests/OrgCoreTests/KeymapTests.swift +3 −3
@@ -95,9 +95,9 @@ struct KeymapTests {
95 let labels = doom.keyLabels(for: "org.todo.cycle", modes: ["normal", "insert"]) 95 let labels = doom.keyLabels(for: "org.todo.cycle", modes: ["normal", "insert"])
96 #expect(labels == ["C-c C-t", "SPC m t"]) 96 #expect(labels == ["C-c C-t", "SPC m t"])
97 #expect(doom.keyLabels(for: "app.quit", modes: ["normal", "insert"]) == ["SPC q q"]) 97 #expect(doom.keyLabels(for: "app.quit", modes: ["normal", "insert"]) == ["SPC q q"])
98 #expect(doom.keyLabels(for: "app.buffer.kill", modes: ["normal"], limit: 3) == ["SPC b d", "SPC b k"]) 98 #expect(doom.keyLabels(for: "app.buffer.kill", modes: ["normal"], limit: 3) == ["C-x k", "SPC b d", "SPC b k"])
99 #expect(doom.keyLabels(for: "app.buffer.next", modes: ["normal"]) == ["] b", "SPC b ]"]) 99 #expect(doom.keyLabels(for: "app.buffer.next", modes: ["normal"]) == ["] b", "C-x <right>"])
100 #expect(emacs.keyLabels(for: "app.buffer.switch") == ["C-x b", "C-x C-b"]) 100 #expect(emacs.keyLabels(for: "app.buffer.switch") == ["C-x C-b", "C-x b"])
101 } 101 }
102 102
103 @Test func dispatchesPrefixes() { 103 @Test func dispatchesPrefixes() {