Skip to content

Commit bf10aa7

Browse files
committed
ci(e2e): treat captcha_enabled drift as critical in the staging gate
1 parent 0eb5396 commit bf10aa7

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

scripts/validate-staging-instances.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ const CRITICAL_PATHS = [
5555
/^user_settings\.social\.[^.]+(\.enabled)?$/,
5656
// Password policy, which affects password sign-in / sign-up flows.
5757
/^user_settings\.password_settings\..+/,
58+
// Bot protection: an enabled captcha blocks every in-browser sign-up in
59+
// headless CI unless the test carries a bypass token (widget type alone is
60+
// inert while captcha is disabled, so it stays informational).
61+
/^user_settings\.sign_up\.captcha_enabled$/,
5862
];
5963

6064
/**

scripts/validate-staging-instances.test.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ describe('isCriticalPath', () => {
346346
expect(isCriticalPath('user_settings.password_settings.min_length')).toBe(true);
347347
});
348348

349+
it('flags captcha_enabled but not captcha_widget_type', () => {
350+
expect(isCriticalPath('user_settings.sign_up.captcha_enabled')).toBe(true);
351+
expect(isCriticalPath('user_settings.sign_up.captcha_widget_type')).toBe(false);
352+
});
353+
349354
it('does not flag cosmetic / non-critical paths', () => {
350355
expect(isCriticalPath('auth_config.single_session_mode')).toBe(false);
351356
expect(isCriticalPath('organization_settings.enabled')).toBe(false);
@@ -389,6 +394,16 @@ describe('classifyMismatches', () => {
389394
const accepted = [{ path: /^user_settings\.password_settings\./, reason: 'x' }];
390395
expect(classifyMismatches('any', mismatches, accepted).blocking).toHaveLength(0);
391396
});
397+
398+
it('blocks on captcha_enabled drift but not captcha_widget_type', () => {
399+
const mismatches = [
400+
{ path: 'user_settings.sign_up.captcha_enabled', prod: false, staging: true },
401+
{ path: 'user_settings.sign_up.captcha_widget_type', prod: 'smart', staging: '' },
402+
];
403+
const { blocking, informational } = classifyMismatches('with-legal-consent', mismatches);
404+
expect(blocking.map(m => m.path)).toEqual(['user_settings.sign_up.captcha_enabled']);
405+
expect(informational.map(m => m.path)).toEqual(['user_settings.sign_up.captcha_widget_type']);
406+
});
392407
});
393408

394409
// ── fetchEnvironment ────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)