feat: edit a transcript in the Notitie editor, delete button per transcript
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,3 +146,24 @@ struct HistoryGroupingTests {
|
||||
#expect(days[0].day > days[1].day)
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
struct HistoryEditTests {
|
||||
@Test func updateTextReplacesFinalTextAndDropsCorrections() {
|
||||
let store = HistoryStore(fileURL: FileManager.default.temporaryDirectory.appending(path: "sst-tests-\(UUID().uuidString)/history.json"))
|
||||
let item = HistoryEntry(
|
||||
date: Date(), duration: 2, rawText: "cloud code", finalText: "Claude Code",
|
||||
corrections: [AppliedCorrection(heard: "cloud code", wrote: "Claude Code", rule: "cloud code", start: 0, length: 11)])
|
||||
store.add(item)
|
||||
store.updateText(id: item.id, to: "Claude Code is fijn")
|
||||
#expect(store.entries[0].finalText == "Claude Code is fijn")
|
||||
#expect(store.entries[0].rawText == "cloud code")
|
||||
#expect(store.entries[0].corrections.isEmpty)
|
||||
}
|
||||
|
||||
@Test func updateTextOfUnknownIdIsHarmless() {
|
||||
let store = HistoryStore(fileURL: FileManager.default.temporaryDirectory.appending(path: "sst-tests-\(UUID().uuidString)/history.json"))
|
||||
store.updateText(id: UUID(), to: "x")
|
||||
#expect(store.entries.isEmpty)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user