import { afterEach, describe, expect, it, vi } from 'vitest'; import { configuredContactFormEnabled } from './contactFormEnv'; describe('configuredContactFormEnabled', () => { afterEach(() => { vi.unstubAllEnvs(); }); it('is closed when nothing is set', () => { vi.stubEnv('VITE_CONTACT_FORM_ENABLED', undefined as unknown as string); expect(configuredContactFormEnabled()).toBe(false); }); it('is open when the build sets it to true', () => { vi.stubEnv('VITE_CONTACT_FORM_ENABLED', 'true'); expect(configuredContactFormEnabled()).toBe(true); }); it('is closed for any other value', () => { vi.stubEnv('VITE_CONTACT_FORM_ENABLED', 'false'); expect(configuredContactFormEnabled()).toBe(false); }); });