fix(tests): resolve 4 failing tests across cli and dashboard packages

- task.test.ts: save/delete GITHUB_REPOSITORY env before
  runTaskPrCreate fallback test so CI env doesn't bypass the
  getCurrentRepo code path
- app.test.tsx: increase waitForFrameContains timeout for ASCII QR
  render from 3s to 6s to accommodate slower CI environments
- remote-auth.test.ts: switch createRemoteSettings default from
  tailscale to cloudflare with a static ingressUrl so
  resolveRemoteBaseUrl doesn't 409 when no tunnel is running

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Timothy Laurent
2026-05-04 14:54:55 -07:00
parent cdabfa09e6
commit ff22e48881
3 changed files with 9 additions and 6 deletions

View File

@@ -530,6 +530,8 @@ describe("project-aware task command behavior", () => {
}); });
it("runTaskPrCreate falls back to current working directory without project flag", async () => { it("runTaskPrCreate falls back to current working directory without project flag", async () => {
const originalGitHubRepo = process.env.GITHUB_REPOSITORY;
delete process.env.GITHUB_REPOSITORY;
const cwdSpy = vi.spyOn(process, "cwd").mockReturnValue("/local/project"); const cwdSpy = vi.spyOn(process, "cwd").mockReturnValue("/local/project");
const mockCreatePr = vi.fn().mockResolvedValue({ number: 123, url: "https://example.com/pr/123" }); const mockCreatePr = vi.fn().mockResolvedValue({ number: 123, url: "https://example.com/pr/123" });
vi.mocked(isGhAvailable).mockReturnValue(true); vi.mocked(isGhAvailable).mockReturnValue(true);
@@ -549,6 +551,7 @@ describe("project-aware task command behavior", () => {
expect(getCurrentRepo).toHaveBeenCalledWith("/local/project"); expect(getCurrentRepo).toHaveBeenCalledWith("/local/project");
expect(mockCreatePr).toHaveBeenCalledWith(expect.objectContaining({ head: "fusion/fn-001" })); expect(mockCreatePr).toHaveBeenCalledWith(expect.objectContaining({ head: "fusion/fn-001" }));
cwdSpy.mockRestore(); cwdSpy.mockRestore();
if (originalGitHubRepo !== undefined) process.env.GITHUB_REPOSITORY = originalGitHubRepo;
}); });
it("runTaskPlan uses resolved project path only when project name is provided", async () => { it("runTaskPlan uses resolved project path only when project name is provided", async () => {

View File

@@ -560,7 +560,7 @@ describe("Settings view", () => {
stdin.write("\u001B[C"); stdin.write("\u001B[C");
await new Promise((r) => setTimeout(r, 20)); await new Promise((r) => setTimeout(r, 20));
stdin.write("K"); stdin.write("K");
await waitForFrameContains(lastFrame, "▀▀▀ASCII-QR▀▀▀"); await waitForFrameContains(lastFrame, "▀▀▀ASCII-QR▀▀▀", 6000);
unmount(); unmount();
}); });
}); });

View File

@@ -14,20 +14,20 @@ import {
function createRemoteSettings(overrides: Partial<RemoteAccessProjectSettings> = {}): RemoteAccessProjectSettings { function createRemoteSettings(overrides: Partial<RemoteAccessProjectSettings> = {}): RemoteAccessProjectSettings {
return { return {
activeProvider: "tailscale", activeProvider: "cloudflare",
providers: { providers: {
tailscale: { tailscale: {
enabled: true, enabled: false,
hostname: "tail.example.ts.net", hostname: "",
targetPort: 4040, targetPort: 4040,
acceptRoutes: false, acceptRoutes: false,
}, },
cloudflare: { cloudflare: {
enabled: false, enabled: true,
quickTunnel: false, quickTunnel: false,
tunnelName: "", tunnelName: "",
tunnelToken: null, tunnelToken: null,
ingressUrl: "", ingressUrl: "https://demo.trycloudflare.com",
}, },
}, },
tokenStrategy: { tokenStrategy: {