settingsRemoteMcpSyncLocalWorkspace.test.ts 809 B

12345678910111213141516171819202122232425
  1. import { readFileSync } from "node:fs";
  2. import { resolve } from "node:path";
  3. import { describe, expect, it } from "vitest";
  4. function readSource(path: string) {
  5. return readFileSync(resolve(process.cwd(), path), "utf8");
  6. }
  7. describe("settings remote sync local workspace path", () => {
  8. it("passes the active tab local workspace path into the MCP settings sync entry", () => {
  9. const pluginSource = readSource(
  10. "packages/ui/src/settings/PluginsSection.tsx",
  11. );
  12. const mcpSettingsSectionSource = readSource(
  13. "packages/ui/src/settings/McpSettingsSection.tsx",
  14. );
  15. expect(pluginSource).toContain(
  16. "localWorkspacePath={mcpTarget.localWorkspacePath}",
  17. );
  18. expect(mcpSettingsSectionSource).toContain(
  19. "mcpLocalWorkspacePath={localWorkspacePath}",
  20. );
  21. });
  22. });