conversation-session-v4-rename.test.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // 通过侧栏现有入口操作,验证真实标题投影或归档后的永久删除。
  2. import { clearAppData } from "#e2e/helpers/desktop-app";
  3. import {
  4. getV4SessionTitle,
  5. prepareV4ConversationE2E,
  6. renameV4Session,
  7. sendV4Prompt,
  8. waitForV4Pane,
  9. waitForV4TimelineContaining,
  10. } from "#e2e/helpers/v4-conversation";
  11. describe("v4 M4 门禁:renameSession", () => {
  12. after(async () => {
  13. await browser.electron.restoreAllMocks();
  14. await clearAppData();
  15. });
  16. it("建立 session → 重命名 → 标题投影更新为自定义值", async () => {
  17. await prepareV4ConversationE2E();
  18. await sendV4Prompt("E2E_V4_RENAME_SEED 建立会话");
  19. await waitForV4TimelineContaining("V4_RENAME_SEED_OK", 45000);
  20. await waitForV4Pane(
  21. (s) => s.sessionId !== "draft" && s.sessionId !== null,
  22. "会话没有建立",
  23. 45000,
  24. );
  25. // 侧栏右键重命名为自定义标题
  26. const customTitle = "E2E_V4_我的自定义会话";
  27. await renameV4Session(customTitle);
  28. // meta.title 投影更新为自定义值(custom 粘性,自动标题不再覆盖)
  29. await browser.waitUntil(async () => (await getV4SessionTitle()) === customTitle, {
  30. timeout: 30000,
  31. timeoutMsg: "会话标题没有更新为自定义值",
  32. });
  33. expect(await getV4SessionTitle()).toBe(customTitle);
  34. });
  35. });