test: remove duplicate and theatrical tests (#2646)

- security.test.ts: remove "should handle prompt with only whitespace"
  (line 614) — fully covered by "should reject empty prompts" (line 363)
  which already tests validatePrompt("   ") and validatePrompt("\n\t")

- script-failure-guidance.test.ts: consolidate three separate "returns
  simple command" tests (no-arg, undefined, empty string) into one.
  All three called buildRetryCommand with absent/falsy prompt and
  asserted identical output — the input variation is not a meaningful
  behavioral distinction.

net: 3 tests removed. 1410 pass, 0 fail. biome lint clean.

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: L <6723574+louisgv@users.noreply.github.com>
This commit is contained in:
A 2026-03-15 02:15:10 -07:00 committed by GitHub
parent 333a3928ad
commit 65b29e3757
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View file

@ -401,8 +401,10 @@ describe("getSignalGuidance", () => {
});
describe("buildRetryCommand", () => {
it("should return simple command without prompt", () => {
it("should return simple command when prompt is absent, undefined, or empty", () => {
expect(buildRetryCommand("claude", "sprite")).toBe("spawn claude sprite");
expect(buildRetryCommand("codex", "vultr", undefined)).toBe("spawn codex vultr");
expect(buildRetryCommand("codex", "vultr", "")).toBe("spawn codex vultr");
});
it("should include --prompt when prompt is provided", () => {
@ -434,14 +436,6 @@ describe("buildRetryCommand", () => {
expect(result).toBe('spawn claude sprite --prompt "Fix \\"all\\" bugs"');
});
it("should return simple command when prompt is undefined", () => {
expect(buildRetryCommand("codex", "vultr", undefined)).toBe("spawn codex vultr");
});
it("should return simple command when prompt is empty string", () => {
expect(buildRetryCommand("codex", "vultr", "")).toBe("spawn codex vultr");
});
// ── spawnName parameter (issue #1709) ────────────────────────────────────
it("should include --name flag when spawnName is provided without prompt", () => {

View file

@ -610,8 +610,4 @@ describe("validatePrompt", () => {
it("should accept semicolons not followed by rm", () => {
expect(() => validatePrompt("echo hello; echo world")).not.toThrow();
});
it("should handle prompt with only whitespace", () => {
expect(() => validatePrompt(" \t\n ")).toThrow("Prompt is required but was not provided");
});
});