adobe / adobe/spacecat-shared

E2E: prompt rename 400 check fails for explicit null new_name (returns 200)

Open Beginner friendly
#1,840 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5
Forks
2
Avg merge
19h 55m
Merged PRs (30d)
33

Description

## Summary

`test/e2e/project-engine-mock.e2e.js` — the test "renames to the empty string for an empty or omitted new_name; 400s EOF for no body" fails on its explicit-`null` sub-case: expected a 400, got a 200.

## Discovery context

Found while resolving merge conflicts for `spacecat-shared#1780` (tag dimension mock fixtures, serenity-docs#26). Confirmed **not caused by that work** — the relevant handler (`mock/counterfact/routes/.../prompts/{prompt_id}/rename.js`) and the e2e test block are unrelated to the tag-dimension changes and reproduce identically against a clean `main` checkout.

## Expected vs actual

- `new_name: null` (explicit) on the in-place prompt rename endpoint should 400 (matches the "empty/omitted" case), per the test's own name.
- Currently returns 200 — the mock accepts a `null` `new_name` as if it were a valid rename.

## Suggested next step

Check the rename handler's validation for `new_name` — likely a falsy-check that catches `''`/`undefined` but not `null` explicitly, or a schema validation gap for the explicit-null case introduced by `#1814` ("mock the in-place prompt rename with 409 on text collision").

Contributor guide

Open the contributing guide

Research direction

Start with test/e2e/project-engine-mock.e2e.js and run the failing rename test to reproduce the explicit-null case. Then inspect mock/counterfact/routes/.../prompts/{prompt_id}/rename.js, focusing on validation for new_name. Done means the explicit null request returns 400 while the existing empty, omitted, and no-body checks still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.