feat: advance and highlight next AI suggestion on accept/deny/copy-to-note, remove copied suggestion from inline list, and add native Linux .deb packaging
This commit is contained in:
@@ -139,6 +139,11 @@ describe("AISidebar + WritingView granular text-pegged suggestion flow", () => {
|
||||
await new Promise((r) => setTimeout(r, 120));
|
||||
});
|
||||
|
||||
// After accepting Suggestion #1, the next suggestion (#2) must be automatically highlighted
|
||||
expect(useProjectStore.getState().highlightedText).toContain(
|
||||
"the light had turned the sea the color of a bruised plum",
|
||||
);
|
||||
|
||||
// Accept Suggestion #2 (clause 2 of the SAME paragraph 2)
|
||||
const acceptBtn2 = Array.from(container.querySelectorAll("button")).find((b) =>
|
||||
b.textContent?.includes("Accept"),
|
||||
@@ -150,6 +155,25 @@ describe("AISidebar + WritingView granular text-pegged suggestion flow", () => {
|
||||
await new Promise((r) => setTimeout(r, 120));
|
||||
});
|
||||
|
||||
// After accepting Suggestion #2, Suggestion #3 (on the next paragraph) must be automatically highlighted
|
||||
expect(useProjectStore.getState().highlightedText).toContain(
|
||||
"She pressed her palm against the cold window",
|
||||
);
|
||||
expect(container.querySelector(".ps-editor")?.getAttribute("data-highlight-line")).toBe("3");
|
||||
|
||||
// Clicking "Copy to Note" on Suggestion #3 removes it from the inline suggestions list
|
||||
const beforeCards = container.querySelectorAll(".ps-ai-suggestion-card").length;
|
||||
const copyToNoteBtn = Array.from(container.querySelectorAll("button")).find((b) =>
|
||||
b.textContent?.includes("Copy to Note"),
|
||||
);
|
||||
expect(copyToNoteBtn).toBeDefined();
|
||||
await act(async () => {
|
||||
copyToNoteBtn!.click();
|
||||
await new Promise((r) => setTimeout(r, 120));
|
||||
});
|
||||
const afterCards = container.querySelectorAll(".ps-ai-suggestion-card").length;
|
||||
expect(afterCards).toBe(beforeCards - 1);
|
||||
|
||||
// Verify BOTH granular clauses in paragraph 2 were updated AND the rest of the paragraph was NOT deleted!
|
||||
const pmText = container.querySelector(".ProseMirror")?.textContent ?? "";
|
||||
expect(pmText).toContain("The ferry that carried Mara Vell to the Glass Harbor cleared the mainland before dawn");
|
||||
|
||||
Reference in New Issue
Block a user