Stub the Arkose public key alongside arkose_enabled?
What does this MR do and why?
The sign-up and identity verification forms use Arkose Labs for bot detection. The components expect a public key to render the widget. In production, the Rails helper only reports arkose_enabled? true when a public key is configured, so a key is always present. The feature spec helper stub_arkose_token_verification only stubbed arkose_enabled? alone. The Rails helper compacts nil values, so data-api-key was omitted from the page data. The JavaScript code then mounted the Arkose apps with publicKey: undefined, causing a prop validation warning.
The warning is: prop "publicKey". Expected String, got Undefined in SignUpArkoseApp and IdentityVerificationArkoseApp.
Fix: the spec helper also stubs arkose_public_api_key with a placeholder string. This is a spec-only change.
Changes made:
ee/spec/support/helpers/identity_verification_helpers.rb
How to set up and validate locally
- Run the feature spec
ee/spec/features/registrations/email_opt_in_registration_spec.rb. - Check the browser console output in the failure log shows no
[Vue warn]line for this warning. - Alternatively, open the sign-up page on an instance with Arkose configured and verify the widget loads.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- I have evaluated the MR acceptance checklist for this MR.
References
- Addresses one entry of #628901 (browser console error catalogue, section C: Vue warnings)
- Warnings surfaced by !255207 (closed) (feature specs fail on console errors)
- Sibling fixes from the same section: !255388 (merged), !255389 (merged), !255390 (merged), !255391 (closed), !255392 (merged), !255393 (closed), !255394 (merged), !255395 (merged), !255396 (merged), !255397 (merged)