Opens the contact form through a build switch instead of the TEST ONLY commit; closes the AI-DLC records
Continuous Integration / check (pull_request) Successful in 2m25s
Continuous Integration / build-test (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m2s
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / check (pull_request) Successful in 2m25s
Continuous Integration / build-test (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m2s
Continuous Integration / deploy-production (pull_request) Skipped
The form is closed unless the build sets VITE_CONTACT_FORM_ENABLED=true (only
the test build does), so d449e76 no longer has to be undone before the merge.
Status files of contact-form-cms, asf-packages-cms, asf-cms-host-injection and
asf-translation-files are closed; Build and Test summary added.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { resolveContactFormEnabled } from './contactFormFlag';
|
||||
|
||||
describe('resolveContactFormEnabled', () => {
|
||||
it('opens the form only for the exact value "true"', () => {
|
||||
expect(resolveContactFormEnabled('true')).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
'TRUE',
|
||||
'True',
|
||||
'1',
|
||||
'yes',
|
||||
'false',
|
||||
'',
|
||||
' true',
|
||||
undefined,
|
||||
null,
|
||||
true,
|
||||
])('keeps the form closed for %j', (value) => {
|
||||
expect(resolveContactFormEnabled(value)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
// Whether the contact form is open. The form stays closed unless a build says
|
||||
// otherwise through VITE_CONTACT_FORM_ENABLED=true (only the test build does;
|
||||
// read in contactFormEnv.ts). Anything else, or nothing, keeps it closed, so a
|
||||
// typo can never open the form in production. Opening it there needs Bryan's
|
||||
// explicit go (see docs/go-live-checklist.md).
|
||||
export function resolveContactFormEnabled(configured: unknown): boolean {
|
||||
return configured === 'true';
|
||||
}
|
||||
Reference in New Issue
Block a user