before the great git rework

This commit is contained in:
2026-10-30 11:27:44 +01:00
parent 9bdda896af
commit b9c03a7637
45 changed files with 70 additions and 562 deletions
@@ -27,10 +27,8 @@ import Testing
@Test func savingFromTheCloseQuestionWritesBeforeTheWindowGoes() async {
let harness = await dirtyHarness()
harness.system.unsavedCloseChoice = .save
harness.model.note?.text = "thought"
#expect(await harness.model.prepareToClose())
#expect(harness.files.current("a.php") == "<?php // unsaved")
#expect(harness.notes.writes == ["thought"])
#expect(harness.session.sessions["/fake/project"]?.active == "a.php")
}
@@ -68,25 +66,6 @@ import Testing
#expect(harness.model.editor !== oldEditor)
#expect(harness.model.editor?.states["a.php"] == nil)
}
@Test func aFailedNoteSaveSaysSo() async {
let harness = WorkspaceHarness()
await harness.start()
harness.notes.failWrites = true
harness.model.note?.text = "keep me"
harness.model.windowDidResignKey()
await harness.model.settle()
#expect(harness.toastTitles.contains("Save failed"))
}
@Test func anOutsideEditOfTheNoteIsPickedUp() async {
let harness = WorkspaceHarness(note: "before")
await harness.start()
harness.notes.setOnDisk("written by the agent")
await harness.model.handle(.project)
await harness.model.settle()
#expect(harness.model.note?.text == "written by the agent")
}
}
@MainActor