fix(hub): make guided setup choices actionable (#3677)
Show a concise login success state, scope starter choices to available Hub connections, wait for daemon capabilities, and avoid partial starter bundles when setup cannot proceed.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { availableStarterTriggerConnections } from "./starter-trigger.js";
|
||||
|
||||
describe("starter trigger connections", () => {
|
||||
it("returns only concrete connections that can back the generated workflow", () => {
|
||||
expect(
|
||||
availableStarterTriggerConnections(
|
||||
{
|
||||
github: [
|
||||
{
|
||||
slug: "github-getpaseo",
|
||||
accountLogin: "getpaseo",
|
||||
accountType: "Organization",
|
||||
repositories: ["getpaseo/paseo"],
|
||||
},
|
||||
],
|
||||
slack: [{ teamId: "T123", teamName: "Paseo" }],
|
||||
discord: [{ guildId: "456", guildName: "Paseo Discord" }],
|
||||
},
|
||||
"getpaseo/paseo",
|
||||
),
|
||||
).toEqual([
|
||||
{
|
||||
id: "github:getpaseo/paseo",
|
||||
label: "GitHub — getpaseo/paseo",
|
||||
provider: "github",
|
||||
filters: { repo: "getpaseo/paseo" },
|
||||
},
|
||||
{
|
||||
id: "slack:T123",
|
||||
label: "Slack — Paseo",
|
||||
provider: "slack",
|
||||
filters: { workspace: "T123" },
|
||||
},
|
||||
{
|
||||
id: "discord:456",
|
||||
label: "Discord — Paseo Discord",
|
||||
provider: "discord",
|
||||
filters: { guild: "456" },
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("does not offer GitHub when the current repository is not connected", () => {
|
||||
expect(
|
||||
availableStarterTriggerConnections(
|
||||
{
|
||||
github: [
|
||||
{
|
||||
slug: "github-getpaseo",
|
||||
accountLogin: "getpaseo",
|
||||
accountType: "Organization",
|
||||
repositories: ["getpaseo/hub"],
|
||||
},
|
||||
],
|
||||
slack: [],
|
||||
discord: [],
|
||||
},
|
||||
"getpaseo/paseo",
|
||||
),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user