Skip to content

test: assert onConfigure blocks invalid app install params [] - #11420

Open
Jared Jolton (jjolton-contentful) wants to merge 1 commit into
masterfrom
test/strengthen-bedrock-braze-install-specs
Open

Jared Jolton (jjolton-contentful) wants to merge 1 commit into
masterfrom
test/strengthen-bedrock-braze-install-specs

Conversation

@jjolton-contentful

Copy link
Copy Markdown
Contributor

Summary

  • bedrock-content-generator (useSaveConfigHandler.spec.tsx): When validation fails, assert onConfigure resolves to false and the notifier shows the error. The prior spec read .parameters on an un-awaited Promise, so a broken save path could stay green.
  • braze (ConfigScreen.spec.tsx): On invalid or missing install fields, assert onConfigure returns false in addition to the error toast. Without that, the handler could return install parameters while the spec still passed.

Test-only changes; no production code.

Rationale

Both specs guard app installation: invalid credentials or missing required fields must block save in Contentful. Stricter assertions catch regressions during refactors without changing runtime behavior.

Test plan

  • cd apps/bedrock-content-generator && npx vitest --run src/hooks/config/useSaveConfigHandler.spec.tsx
  • cd apps/braze && npm test -- --run test/locations/ConfigScreen.spec.tsx
  • Green-then-red (local, impl not committed): Bedrock — return install payload instead of false on validation errors → invalid-params test fails on resolves.toBe(false). Braze — same mutation on validation branch → three negative install tests fail on toBe(false).

Strengthen bedrock-content-generator and braze config specs so invalid
installation input must resolve to false, not only show a toast or touch
an un-awaited Promise.

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