| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { describe, expect, it } from "vitest";
- import { resolveAppWorkspaceRpcTarget } from "@/app-shell/workspaceRpcTarget.js";
- describe("resolveAppWorkspaceRpcTarget", () => {
- it("falls back to the explicit remote workspace identity when active tab has no workspace metadata", () => {
- const workspaceIdentity =
- "remote:ssh:124.223.19.106:22:ubuntu:/home/ubuntu/workspace";
- expect(
- resolveAppWorkspaceRpcTarget({
- activeTarget: {
- workspaceIdentity: undefined,
- remoteSessionId: undefined,
- remoteTarget: undefined,
- },
- explicitWorkspaceIdentity: workspaceIdentity,
- explicitRemoteSessionId: undefined,
- }),
- ).toEqual({
- workspaceIdentity,
- remoteSessionId: undefined,
- remoteTarget: undefined,
- });
- });
- it("does not add remote identity or session for a local workspace", () => {
- expect(
- resolveAppWorkspaceRpcTarget({
- activeTarget: {
- workspaceIdentity: undefined,
- remoteSessionId: undefined,
- remoteTarget: undefined,
- },
- explicitWorkspaceIdentity: undefined,
- explicitRemoteSessionId: undefined,
- }),
- ).toEqual({
- workspaceIdentity: undefined,
- remoteSessionId: undefined,
- remoteTarget: undefined,
- });
- });
- });
|