From ee83e46d9b2dca3d8e764ab8276c7bb759d717dd Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Sat, 28 Feb 2026 01:11:48 -0800 Subject: [PATCH] test: Remove duplicate and theatrical tests (#2016) Remove 3 duplicate tests from security-edge-cases.test.ts that were already covered in security.test.ts: - validateIdentifier: "reject 65-char identifier" (duplicate of security.test.ts "should reject overly long identifiers") - validateScriptContent: "accept wget|sh" (duplicate of security.test.ts "should accept scripts with wget|bash") - validatePrompt: "accept prompts at exactly the max length" (duplicate of security.test.ts "should accept prompts at the size limit") The edge-cases file retains unique tests: 64-char boundary check, single char identifiers, mkfs with multiple filesystems, extra-whitespace pipe detection, etc. Co-authored-by: spawn-qa-bot Co-authored-by: Claude Sonnet 4.6 Co-authored-by: L <6723574+louisgv@users.noreply.github.com> --- .../src/__tests__/security-edge-cases.test.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/cli/src/__tests__/security-edge-cases.test.ts b/packages/cli/src/__tests__/security-edge-cases.test.ts index 5132e23f..bebb5a14 100644 --- a/packages/cli/src/__tests__/security-edge-cases.test.ts +++ b/packages/cli/src/__tests__/security-edge-cases.test.ts @@ -14,11 +14,6 @@ describe("Security Edge Cases", () => { expect(() => validateIdentifier(id, "Test")).not.toThrow(); }); - it("should reject identifier at 65 characters", () => { - const id = "a".repeat(65); - expect(() => validateIdentifier(id, "Test")).toThrow("too long"); - }); - it("should accept single character identifiers", () => { expect(() => validateIdentifier("a", "Test")).not.toThrow(); expect(() => validateIdentifier("1", "Test")).not.toThrow(); @@ -139,13 +134,6 @@ echo "safe" expect(() => validateScriptContent(script)).toThrow("destructive filesystem operation"); }); - it("should accept wget|sh (used by spawn scripts)", () => { - const script = `#!/bin/bash -wget -q https://example.com/install.sh | sh -`; - expect(() => validateScriptContent(script)).not.toThrow(); - }); - it("should accept scripts with curl used safely", () => { const safe = `#!/bin/bash curl -fsSL https://example.com/file.tar.gz -o /tmp/file.tar.gz @@ -195,11 +183,6 @@ dd if=/dev/urandom of=/tmp/random.bin bs=1M count=1 expect(() => validatePrompt("Count lines | wc -l")).not.toThrow(); }); - it("should accept prompts at exactly the max length", () => { - const maxPrompt = "x".repeat(10 * 1024); - expect(() => validatePrompt(maxPrompt)).not.toThrow(); - }); - it("should reject prompts one byte over the max length", () => { const overPrompt = "x".repeat(10 * 1024 + 1); expect(() => validatePrompt(overPrompt)).toThrow("too long");