remoteSkillSyncEntryVisibility.test.ts 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { describe, expect, it } from "vitest";
  2. import { shouldShowRemoteSkillSyncAction } from "../src/WorkspaceHeaderSections.js";
  3. describe("shouldShowRemoteSkillSyncAction", () => {
  4. it("only shows the remote skill sync action for connected SSH workspaces", () => {
  5. expect(
  6. shouldShowRemoteSkillSyncAction({
  7. remoteSessionId: "session-1",
  8. remoteTarget: {
  9. kind: "ssh",
  10. host: "dev.example.com",
  11. username: "alice",
  12. port: 22,
  13. },
  14. }),
  15. ).toBe(true);
  16. expect(
  17. shouldShowRemoteSkillSyncAction({
  18. remoteSessionId: "session-1",
  19. remoteTarget: { kind: "docker", container: "app" },
  20. }),
  21. ).toBe(false);
  22. expect(
  23. shouldShowRemoteSkillSyncAction({
  24. remoteSessionId: null,
  25. remoteTarget: {
  26. kind: "ssh",
  27. host: "dev.example.com",
  28. username: "alice",
  29. port: 22,
  30. },
  31. }),
  32. ).toBe(false);
  33. });
  34. });