Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe("cloud onboarding discovery", () => {
finishDiscovery(linkedMachines);
});
expect(onDiscoveryReady).toHaveBeenCalledTimes(1);
expect(renderer!.root.findByType("button").children).toEqual(["Connect"]);
expect(renderer!.root.findByType("button").children).toEqual(["Add"]);
});

it("connects and selects discovered computers by default without overwriting deselection", async () => {
Expand Down Expand Up @@ -232,15 +232,15 @@ describe("cloud onboarding discovery", () => {
expect(renderer!.root.findAllByType("p").map((node) => node.children)).toContainEqual([
"Work laptop",
]);
expect(renderer!.root.findByType("button").children).toEqual(["Connect"]);
expect(renderer!.root.findByType("button").children).toEqual(["Add"]);
await advance(30_000);
expect(discovery.listEnvironments).toHaveBeenCalledTimes(2);
});

it("keeps a discovered computer visible when it is added to the browser", async () => {
discovery.listEnvironments.mockResolvedValue(linkedMachines);
await mount();
expect(renderer!.root.findByType("button").children).toEqual(["Connect"]);
expect(renderer!.root.findByType("button").children).toEqual(["Add"]);
await act(async () => {
renderer!.update(
<CloudEnvironmentConnectRows
Expand Down
11 changes: 6 additions & 5 deletions apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@ export function CloudEnvironmentConnectRows({
const statusText = savedConnection
? savedConnection.statusText
: availability === "online"
? "Available · Relay online"
? "T3 Connect · Not added · Relay online"
: availability === "offline"
? "Available · Relay offline"
? "T3 Connect · Not added · Relay offline"
: availability === "checking"
? "Available · Checking relay status…"
: (Option.getOrNull(error)?.message ?? "Available · Relay status unavailable");
? "T3 Connect · Not added · Checking relay status…"
: (Option.getOrNull(error)?.message ??
"T3 Connect · Not added · Relay status unavailable");
if (selection) {
return (
<label
Expand Down Expand Up @@ -386,7 +387,7 @@ export function CloudEnvironmentConnectRows({
disabled={connectingEnvironmentIds.size > 0}
onClick={() => void connectEnvironment(environment)}
>
{connectingEnvironmentIds.has(environment.environmentId) ? "Connecting…" : "Connect"}
{connectingEnvironmentIds.has(environment.environmentId) ? "Adding…" : "Add"}
</Button>
)}
</div>
Expand Down
Loading
Loading