дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
test(editor): make the detach-tab save-failure document dirty (#924)
Since #920, saves skip clean documents, so the detach-tab save-failure test never reached its mocked failing save. The test now edits the document first, keeping its intent: a failing save keeps the tab and opens no window. Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
1 джерело
0a24b79b50
коміт
416b65d65e
1 file changed
+3
@@ -82,6 +82,9 @@ describe("detachTab", () => {
|
||||
ctrl.start();
|
||||
await ctrl.openFile(path, { focus: false });
|
||||
const [pane, id] = current();
|
||||
// Clean documents skip saving entirely, so the document must be dirty for
|
||||
// the mocked save failure to be reached.
|
||||
ctrl.slotFor(id)!.dispatchLocal({ changes: { from: 0, to: 8, insert: "edited" } });
|
||||
vi.spyOn(backend, "save").mockRejectedValue(new Error("save failed"));
|
||||
expect(await ctrl.detachTab(pane, id)).toBe(false);
|
||||
expect(hasTab(id)).toBe(true);
|
||||
|
||||
Reference in new issue
Заблокувати користувача