conversation-session-plugin-mcp-skill-workspace-root.test.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { existsSync } from "node:fs";
  2. import { join } from "node:path";
  3. import {
  4. clearAppData,
  5. getE2EAppDataPaths,
  6. } from "../../../helpers/desktop-app.js";
  7. import {
  8. PLUGIN_MCP_PLUGIN_ID,
  9. PLUGIN_MCP_PLUGIN_ROOT,
  10. } from "../../../helpers/plugin-mcp-skill.js";
  11. import {
  12. assertWorkspacePluginRuntime,
  13. readWorkspacePluginConfig,
  14. } from "../../../helpers/workspace-plugin-runtime.js";
  15. describe("WPL-014 Workspace Plugin root E2E", () => {
  16. after(async () => {
  17. await browser.electron.restoreAllMocks();
  18. await clearAppData();
  19. });
  20. it("activates a project Plugin root without a User package record", async function () {
  21. this.timeout(240000);
  22. const { storageRoot } = getE2EAppDataPaths();
  23. const workspaceConfig = await readWorkspacePluginConfig();
  24. expect(workspaceConfig.plugins).toMatchObject({
  25. dirs: [PLUGIN_MCP_PLUGIN_ROOT],
  26. enabledPlugins: { [PLUGIN_MCP_PLUGIN_ID]: true },
  27. });
  28. const installedRecordsPath = join(storageRoot, "cli", "plugins", "installed_plugins.json");
  29. expect(existsSync(installedRecordsPath)).toBe(false);
  30. // Workspace dirs 由新 App 的 runtime discovery 读取;当前 E2E 不把 Host 官方 cache
  31. // refresh 的 overview 列表当作 root discovery 的唯一证据。
  32. await assertWorkspacePluginRuntime("E2E_PLUGIN_MCP_PING_WORKSPACE_ROOT");
  33. });
  34. });