Skip to content

chore(tests): standardize api key placeholder values in specs - #639

Merged
hitesh-shetty-cstk merged 2 commits into
mainfrom
fix/approved-placeholder-values-in-tests
Aug 24, 2026
Merged

hitesh-shetty-cstk merged 2 commits into
mainfrom
fix/approved-placeholder-values-in-tests

Conversation

@hitesh-shetty-cstk

@hitesh-shetty-cstk hitesh-shetty-cstk commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

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

File Lines
src/configManager/__test__/handleUserConfig.test.ts 13
src/livePreview/__test__/live-preview.test.ts 3
src/preview/__test__/contentstack-live-preview-HOC.test.ts 4

19 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.ts has 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 both YOUR_API_KEY, the assertion would pass even if precedence broke. The header value there stays distinct as YOUR_HEADER_API_KEY.

Deliberately left alone:

  • The 94 other occurrences of bltapikey, which are cslp path fixtures such as all_fields.bltapikey.en-us.title in 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 of handleUserConfig.test.ts. Only the api_key on the line above changed, so the branch assertion still reads as intended.

Test plan

  • vitest run on the three affected specs — 80 passed
  • vitest run full suite — 112 files, 877 tests, all passed

🤖 Generated with Claude Code

@hitesh-shetty-cstk
hitesh-shetty-cstk requested a review from a team as a code owner August 24, 2026 11:43
@snyk-io

snyk-io Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 1 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@hitesh-shetty-cstk hitesh-shetty-cstk changed the title fix(tests): use approved placeholder values for api key literals chore(tests): standardize api key placeholder values in specs Aug 24, 2026
@hitesh-shetty-cstk
hitesh-shetty-cstk force-pushed the fix/approved-placeholder-values-in-tests branch from 74ea329 to 27e9657 Compare August 24, 2026 11:48
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>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 1 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.36% 2524 / 3747
🔵 Statements 66.22% 2563 / 3870
🔵 Functions 64.56% 450 / 697
🔵 Branches 61.9% 1529 / 2470
File CoverageNo changed files found.
Generated in workflow #895 for commit 2f8e33c by the Vitest Coverage Report Action

@hitesh-shetty-cstk
hitesh-shetty-cstk force-pushed the fix/approved-placeholder-values-in-tests branch from 27e9657 to 0fe5a58 Compare August 24, 2026 11:52
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 1 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@kirtesh-cstk kirtesh-cstk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@shivamfl shivamfl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hitesh-shetty-cstk
hitesh-shetty-cstk merged commit 2074acf into main Aug 24, 2026
10 checks passed
@hitesh-shetty-cstk
hitesh-shetty-cstk deleted the fix/approved-placeholder-values-in-tests branch August 24, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants