diff --git a/extensions/cli/src/e2e/auth.test.ts b/extensions/cli/src/e2e/auth.test.ts deleted file mode 100644 index 7ada1f0e0..000000000 --- a/extensions/cli/src/e2e/auth.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import fs from "fs/promises"; -import path from "path"; - -import { - cleanupTestContext, - createTestContext, - runCLI, -} from "../test-helpers/cli-helpers.js"; -import { cleanupMocks } from "../test-helpers/mock-helpers.js"; - -describe("E2E: Authentication", () => { - let context: any; - - beforeEach(async () => { - context = await createTestContext(); - }); - - afterEach(async () => { - cleanupMocks(); - await cleanupTestContext(context); - }); - - describe("logout command", () => { - it("should remove auth credentials", async () => { - const authPath = path.join(context.testDir, ".continue", "auth.json"); - - // Create auth file - await fs.mkdir(path.dirname(authPath), { recursive: true }); - await fs.writeFile( - authPath, - JSON.stringify({ - userId: "test-user", - userEmail: "test@example.com", - accessToken: "test-token", - refreshToken: "test-refresh-token", - expiresAt: Date.now() + 3600000, - organizationId: null, - }), - ); - - // Run logout - const result = await runCLI(context, { - args: ["logout"], - env: { - HOME: context.testDir, - CONTINUE_GLOBAL_DIR: path.join(context.testDir, ".continue"), - }, - }); - - expect(result.exitCode).toBe(0); - expect(result.stdout).toContain("Successfully logged out"); - - // Check auth file is removed - const authExists = await fs - .access(authPath) - .then(() => true) - .catch(() => false); - expect(authExists).toBe(false); - }); - - it("should handle logout when not logged in", async () => { - const result = await runCLI(context, { - args: ["logout"], - env: { - HOME: context.testDir, - CONTINUE_GLOBAL_DIR: path.join(context.testDir, ".continue"), - }, - }); - - expect(result.exitCode).toBe(0); - expect(result.stdout).toContain("No active session found"); - }); - }); -}); diff --git a/extensions/cli/src/e2e/basic-commands.test.ts b/extensions/cli/src/e2e/basic-commands.test.ts index c738bea3e..41e77e4e0 100644 --- a/extensions/cli/src/e2e/basic-commands.test.ts +++ b/extensions/cli/src/e2e/basic-commands.test.ts @@ -47,24 +47,6 @@ describe("E2E: Basic Commands", () => { const result = await runCLI(context, { args: ["--help"] }); expect(result.stdout).toContain("Commands:"); - expect(result.stdout).toContain("login"); - expect(result.stdout).toContain("logout"); - }); - }); - - describe("subcommand help", () => { - it("should show help for login command", async () => { - const result = await runCLI(context, { args: ["login", "--help"] }); - - expect(result.exitCode).toBe(0); - expect(result.stdout).toContain("Authenticate with Continue"); - }); - - it("should show help for logout command", async () => { - const result = await runCLI(context, { args: ["logout", "--help"] }); - - expect(result.exitCode).toBe(0); - expect(result.stdout).toContain("Log out from Continue"); }); }); diff --git a/extensions/cli/src/e2e/headless-anthropic-api-key.test.ts b/extensions/cli/src/e2e/headless-anthropic-api-key.test.ts index 29ba6b8a0..2cc861574 100644 --- a/extensions/cli/src/e2e/headless-anthropic-api-key.test.ts +++ b/extensions/cli/src/e2e/headless-anthropic-api-key.test.ts @@ -94,31 +94,10 @@ models: timeout: 15000, }); - // The CLI should create config but fail due to invalid API key - // This is expected behavior - invalid API keys should cause authentication errors + // The CLI should fail because auto-config from ANTHROPIC_API_KEY no longer creates a model expect(result.exitCode).toBe(1); - // Should contain authentication error (not service initialization error) - expect(result.stderr).toContain("authentication_error"); - expect(result.stderr).toContain("invalid x-api-key"); - - // Should NOT contain the old error about service initialization - expect(result.stderr).not.toContain("Failed to initialize ConfigService"); - - // Verify config.yaml was automatically created - const configPath = path.join(context.testDir, ".continue", "config.yaml"); - const configExists = await fs - .stat(configPath) - .then(() => true) - .catch(() => false); - expect(configExists).toBe(true); - - if (configExists) { - const configContent = await fs.readFile(configPath, "utf-8"); - expect(configContent).toContain("anthropic/claude-sonnet-4-6"); - expect(configContent).toContain( - "ANTHROPIC_API_KEY: TEST-test-invalid-key-format", - ); - } + // Should contain error about no model being specified + expect(result.stderr).toContain("No model specified in headless mode"); }, 20000); }); diff --git a/extensions/cli/src/e2e/headless-org-flag.test.ts b/extensions/cli/src/e2e/headless-org-flag.test.ts index 3cffb67fd..76412f296 100644 --- a/extensions/cli/src/e2e/headless-org-flag.test.ts +++ b/extensions/cli/src/e2e/headless-org-flag.test.ts @@ -48,7 +48,7 @@ models: expect(result.exitCode).not.toBe(0); expect(result.stderr).toContain( - "--org flag is only supported in headless mode (with -p/--print flag)", + "Cannot start TUI in TTY-less environment", ); });