Skip to content

test: tighten SFCC and Vercel install-parameter specs [] - #11419

Open
Jared Jolton (jjolton-contentful) wants to merge 1 commit into
masterfrom
test/strengthen-sfcc-vercel-config-specs
Open

Jared Jolton (jjolton-contentful) wants to merge 1 commit into
masterfrom
test/strengthen-sfcc-vercel-config-specs

Conversation

@jjolton-contentful

Copy link
Copy Markdown
Contributor

Summary

  • Salesforce Commerce Cloud (ConfigScreen.spec.tsx): Assert the rendered config heading and that onConfigure returns false when required credentials are empty. The previous example expected scaffold copy and did not await the async query, so it could pass without checking the current UI or install validation.
  • Vercel app actions (fetch-app-installation-parameters.spec.ts): Call fetchAppInstallationParameters in the missing-parameters example and assert a TypeError is thrown. The prior example never invoked the helper, so it did not exercise parameter validation.

Test-only changes; no production code.

Rationale

These specs guard app installation and stored installation parameters. Tighter assertions help catch regressions during refactors (UI copy updates or stricter install validation) without changing runtime behavior.

Test plan

  • cd apps/salesforce-commerce-cloud && npm test -- --run src/locations/ConfigScreen.spec.tsx
  • cd apps/vercel/app-actions && NODE_ENV=test TS_NODE_TRANSPILE_ONLY=1 npx mocha --exit --grep fetchAppInstallationParameters
  • Green-then-red locally: updated SFCC spec fails if reverted to stale scaffold copy (awaited query); updated Vercel spec fails if parameter validation is disabled in the helper (mutation not committed)

Assert real config UI and onConfigure validation for SFCC, and
invoke fetchAppInstallationParameters in the missing-params case so
TypeError expectations are exercised.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant