| ... | @@ -1,31 +0,0 @@ |
| 1 | import { expect, it } from "@effect/vitest"; |
| 2 | |
| 3 | import { |
| 4 | renderLoopbackAuthorizationCompleteHtml, |
| 5 | resolveLoopbackAuthorizationStage, |
| 6 | } from "./cliAuthHtml.ts"; |
| 7 | |
| 8 | it("renders the branded loopback authorization completion page", () => { |
| 9 | const html = renderLoopbackAuthorizationCompleteHtml(); |
| 10 | |
| 11 | expect(resolveLoopbackAuthorizationStage()).toBe("dev"); |
| 12 | expect(html).toContain("T3 Code (Dev)"); |
| 13 | expect(html).toContain('class="stage stage-dev"'); |
| 14 | expect(html).not.toContain("Secure terminal handoff"); |
| 15 | expect(html).toContain("You're connected"); |
| 16 | expect(html).toContain("Return to your terminal"); |
| 17 | expect(html).not.toContain('class="next"'); |
| 18 | expect(html).toContain('name="viewport"'); |
| 19 | expect(html).not.toContain('class="status"'); |
| 20 | }); |
| 21 | |
| 22 | it("renders the matching header treatment for each release channel", () => { |
| 23 | const nightly = renderLoopbackAuthorizationCompleteHtml("nightly"); |
| 24 | const latest = renderLoopbackAuthorizationCompleteHtml("latest"); |
| 25 | |
| 26 | expect(nightly).toContain("T3 Code (Nightly)"); |
| 27 | expect(nightly).toContain('class="stage stage-nightly"'); |
| 28 | expect(latest).toContain('<p class="brand">T3 Code</p>'); |
| 29 | expect(latest).not.toContain("(Latest)"); |
| 30 | expect(latest).toContain('class="stage stage-latest"'); |
| 31 | }); |