test(api): mark api-invalid-key as @stable - #167
Merged
Conversation
added 2 commits
May 6, 2026 14:51
- Add @stable and @api tags to all 6 tests (kept @release/@workspace/@regression). - Refactor cleanup pattern: assert createRes.status() before extracting flowId, removing 'if (flowId)' conditionals in finally blocks (silenced 2 playwright/no-conditional-in-test warnings). - Add spec doc docs/api/flows/api-invalid-key.md (mandatory per CLAUDE.md). - Mark QA-CHECKLIST line 99 with spec filename. Validation pipeline (7/7): - typecheck clean, npm run lint clean (0 errors/warnings on file) - 6/6 PASS in 1.3s, --retries=0 - force-fail: changed expect to [999] -> Test 2 failed at :36:21 as expected; reverted - --trace=on captured - zero backend errors in output
- expect(flowId).toBeTruthy() after destructuring in tests 4 and 6 —
surfaces a clear failure if the API ever returns 201 without an id,
instead of issuing DELETE /api/v1/flows/undefined.
- Consolidate two-line comments into a single WHY line per CLAUDE.md
("don't explain WHAT").
Pipeline re-run: typecheck/lint/linter-skill clean; 6/6 pass in 1.2s
with --retries=0; force-fail on the new guard fails at line 68:22 with
clear message; --trace=on captured; zero 🚨 Backend Error.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the API invalid-auth coverage to be eligible for the weekly stable workflow, while aligning the spec with the repository’s tagging and documentation requirements for @stable tests.
Changes:
- Tagged all tests in
api-invalid-key.spec.tswith@stableand@api(retaining existing tags). - Refactored cleanup in the flow-creating tests to assert successful creation before using
flowId, removing conditional cleanup branches. - Added a required spec document under
docs/and updatedQA-CHECKLIST.mdto mark the scenario as validated.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/tests-automations/regression/api/flows/api-invalid-key.spec.ts | Adds @stable/@api tags and simplifies cleanup logic in tests that create a temporary flow. |
| QA-CHECKLIST.md | Marks “POST with invalid API key” as validated and links to the spec filename. |
| docs/api/flows/api-invalid-key.md | Adds the required test spec documentation for the invalid-key API coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
|
|
||
| ## Validation criterion *(required)* | ||
| - All four "rejected status" assertions return one of the documented codes (`401`, `403`, or `422` for malformed-create). |
Collaborator
Author
There was a problem hiding this comment.
Fixed in 10c7798. Reworded to "Every "rejected status" assertion across the 6 tests returns one of the documented codes (401, 403, or 422 for malformed-create)" — covers all 6 rejection assertions and is robust to future additions.
added 2 commits
May 12, 2026 11:08
…ests Original wording said "All four rejected status assertions" but the spec has 6 rejection assertions (one per test). Replace with phrasing that covers every rejection check across the 6 tests, addressing Copilot review feedback on PR #167.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@stableand@apitags to all 6 tests inapi-invalid-key.spec.ts(kept@release,@workspace,@regression).createRes.status() === 201before extractingflowId, removingif (flowId)conditionals infinallyblocks. Silences 2playwright/no-conditional-in-testwarnings without weakening test behavior.docs/api/flows/api-invalid-key.md(mandatory per CLAUDE.md PR review checklist).QA-CHECKLIST.mdline 99 (POST with invalid API key): flip[-] → [x]and append spec filename.Validation pipeline (all 7 steps performed)
npm run typecheck— cleannpm run lintfiltered to file — 0 errors / 0 warnings (after refactor)playwright-test-linterskill checklist — clean (noif/elsein test logic, no.catch(()=>false), no standalone.isVisible(), no swallowingtry/catch; expect-count ratio is 10/6 by design — each test asserts a single status-code contract)npx playwright test ... --workers=1 --retries=0— 6/6 pass, 1.3s, no retriesexpect([401, 403]).toContain(...)toexpect([999]).toContain(...)in Test 2; that test failed exactly at line 36:21 (others continued passing); reverted; final run clean--trace=onrun — trace captured🚨 Backend Error:in outputWhy both
@stableand@apiare added@stableputs the spec in the weekly stable workflow, the goal of this validation pass.@apiwas missing from the original tags; perCLAUDE.mdtag semantics (@api — Tests exercising REST API endpoints), every spec underregression/api/should carry it. The previously mergedapi-health-check.spec.tsalready follows this convention. Adding here for parity.Test plan
langflow-nightlyathttp://localhost:7860.pr-validation.yml(typecheck + lint) passes.weekly-stable.ymlpicks up the test on next Monday's run.