Public: anyone can read this; the crew can change it.
Connect's first step opens the provider's token page with a 44px button #16805
Check · Review · Land · Live done — Landed and live in production.
sold/connect-btn → main 0 commits
2 files
changed +8
−1
src/web/pages/cloud.ts +2 −1
| @@ -394,7 +394,8 @@ function connectGaps(g: ConnectGuide, summary: string): Html[] { | ||
| 394 | 394 | |
| 395 | 395 | const guideRows = (g: ConnectGuide): Html => |
| 396 | 396 | rowList([ |
| 397 | row({ num: 1, title: html`Open <a href="${g.link}" rel="noopener noreferrer" target="_blank">${LABEL[g.provider]}'s token page</a>.` }), | |
| 397 | // The step's one action: a 44px button to the provider's token page, not a line of text. | |
| 398 | row({ num: 1, title: btn(`Open ${LABEL[g.provider]}'s token page`, { href: g.link, icon: "external", variant: "secondary", size: "lg" }) }), | |
| 398 | 399 | ...g.steps.map((step, i) => row({ num: i + 2, title: step })), |
| 399 | 400 | ]); |
| 400 | 401 |
test/cloud-connect.test.ts +6
| @@ -125,6 +125,12 @@ describe("connect a cloud", () => { | ||
| 125 | 125 | test("a provider's page says where the key is made, what to tick, and asks for it masked and focused", async () => { |
| 126 | 126 | const text = await (await get("/cloud/connect/digitalocean", adminTok)).text(); |
| 127 | 127 | expect(text).toContain('href="https://cloud.digitalocean.com/account/api/tokens/new"'); |
| 128 | // The step's one action is a 44px button (data-size="lg"), not a line of 17px text, and opens a new tab. | |
| 129 | const button = /<a\s+href="https:\/\/cloud\.digitalocean\.com\/account\/api\/tokens\/new"[^>]*>/.exec(text)?.[0] ?? ""; | |
| 130 | expect(button).toContain('class="btn"'); | |
| 131 | expect(button).toContain('data-size="lg"'); | |
| 132 | expect(button).toContain('target="_blank"'); | |
| 133 | expect(text).toContain("Open DigitalOcean's token page"); | |
| 128 | 134 | expect(text).toContain("Name it forge and pick Custom Scopes."); |
| 129 | 135 | expect(text.indexOf("Custom Scopes")).toBeLessThan(text.indexOf("Full Access")); |
| 130 | 136 | expect(text).toContain('type="password"'); |
new above
offline