chore(tests): standardize api key placeholder values in specs - #639
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
74ea329 to
27e9657
Compare
Spec fixtures used ad hoc api key strings that read like real stack keys (bltanything, bltapikey, livePreviewApiKey123, test-key), so sample data was hard to tell apart from meaningful values. Replace them all with YOUR_API_KEY. The one exception is the test asserting that a user-config api key takes precedence over an SDK header api key, where the header keeps a distinct YOUR_HEADER_API_KEY so the assertion still proves precedence rather than passing trivially. Co-Authored-By: Claude <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Coverage Report
File CoverageNo changed files found. |
27e9657 to
0fe5a58
Compare
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
Summary
Spec fixtures across three files used ad hoc api key strings —
bltanything,bltapikey,bltuserapikey,livePreviewApiKey123,test-key,partial-key— that read like real stack keys. Anyone skimming the specs has to stop and work out whether a value carries meaning or is arbitrary.This standardizes them on one placeholder,
YOUR_API_KEY. Test fixtures only; no source or behaviour changes.Changes
src/configManager/__test__/handleUserConfig.test.tssrc/livePreview/__test__/live-preview.test.tssrc/preview/__test__/contentstack-live-preview-HOC.test.ts19 of the 20 edited lines use
YOUR_API_KEY. Assertions comparing against a renamed value are updated in the same commit, so every test asserts exactly what it asserted before.The one exception.
handleUserConfig.test.tshas a test asserting that a user-config api key takes precedence over an SDK header api key. Both values have to differ for the final assertion to mean anything — if they were bothYOUR_API_KEY, the assertion would pass even if precedence broke. The header value there stays distinct asYOUR_HEADER_API_KEY.Deliberately left alone:
bltapikey, which are cslp path fixtures such asall_fields.bltapikey.en-us.titlein the visualBuilder specs. Those strings are entry paths, not credentials, and renaming them would churn a large number of unrelated assertions.branch: "sdkbranch"on line 315 ofhandleUserConfig.test.ts. Only theapi_keyon the line above changed, so the branch assertion still reads as intended.Test plan
vitest runon the three affected specs — 80 passedvitest runfull suite — 112 files, 877 tests, all passed🤖 Generated with Claude Code