refactor(forms): enable approved Form A placements by default

This commit is contained in:
DeCentN2Madness committed 2026-10-30 15:08:02 -07:00
1 parent 55adb79705
commit 95c5f229f5
41 files changed
+862 -523

No files matched your search

+31 -16
View File
@@ -81,20 +81,31 @@ test('photos, responsive variants and licensed fonts are self-hosted', () => {
}
});
test('inactive lead presentation has no native submission surface or live integration runtime', () => {
test('campaign panels use bounded default live frames or explicitly inactive controls', () => {
for (const page of pages) {
const $ = html(page);
assert.equal($('form').length, 0);
assert.equal($('#lead-form').attr('data-forms-mode'), 'off');
assert.equal($('#lead-form [name]:not([disabled])').length, 0);
assert.equal($('#lead-form button').attr('type'), 'button');
assert.ok($('#lead-form button').is('[disabled]'));
const live = $('[data-jotform-form-a]').length === 1;
if (!live) {
assert.equal($('#lead-form').attr('data-forms-mode'), 'off');
assert.equal($('#lead-form [name]:not([disabled])').length, 0);
assert.equal($('#lead-form button').attr('type'), 'button');
assert.ok($('#lead-form button').is('[disabled]'));
} else {
assert.equal($('[data-jotform-form-a]').attr('data-form-mode'), 'live');
assert.equal($('iframe').attr('src'), 'https://form.jotform.com/262946078314059?formContext=landing&language=en');
assert.equal($('#lead-form').length, 0);
}
assert.equal($('[data-form-status-notice], #campaign-form-status').length, 0);
assert.equal($('#lead-form a[href^="tel:"]').length, 1);
assert.equal($('#lead-form a[href="/privacy-policy"]').length, 1);
assert.ok($('.consultation a[href^="tel:"]').length);
assert.ok($('a[href="/privacy-policy"]').length);
if (!live) {
assert.equal($('#lead-form a[href^="tel:"]').length, 1);
assert.equal($('#lead-form a[href="/privacy-policy"]').length, 1);
}
assert.doesNotMatch($('#lead-form').text(), /(?:online )?(?:forms?|requests?|submissions?) (?:are |is )?(?:unavailable|not enabled)|detailed medical|diagnostic|insurance-member/i);
assert.equal($('#lead-form p:empty').length, 0);
assert.equal($('iframe').length, 0);
assert.equal($('iframe').length, live ? 1 : 0);
assert.equal($('script[src]').length, 0);
assert.doesNotMatch($('script').text(), /gtag|googletagmanager|sessionStorage|fetch\(|utm_|gclid|postMessage/);
}
@@ -108,8 +119,8 @@ test('campaign contact paths remain without unavailable-form messaging', () => {
assert.doesNotMatch(heroNote, /online forms are not enabled/i);
assert.ok($('.hero .form-note a[href^="tel:"]').length);
assert.doesNotMatch($('#lead-form').text(), /By submitting this form/i);
assert.ok($('#lead-form a[href^="tel:"]').length);
assert.ok($('#lead-form a[href="/privacy-policy"]').length);
assert.ok($('a[href^="tel:"]').length);
assert.ok($('a[href="/privacy-policy"]').length);
assert.doesNotMatch($('#lead-form').text(), /(?:online )?(?:forms?|requests?|submissions?) (?:are |is )?(?:unavailable|not enabled)/i);
assert.doesNotMatch($('.consultation__contact').text(), /Online (?:forms|requests|submissions)/i);
}
@@ -146,16 +157,20 @@ test('early-intervention preserves its own publication identity and source secti
assert.equal($('h1').length, 1);
assert.equal($('main').length, 1);
assert.equal($('link[rel="canonical"]').attr('href'), 'https://www.azinstitute4autism.com/lp/early-intervention');
assert.equal($('.qr-landing section').length, 7);
assert.equal($('.qr-landing section:not([data-jotform-form-a])').length, 7);
assert.equal($('.qr-benefit-card').length, 3);
assert.equal($('.qr-process-step').length, 3);
assert.equal($('form, input[type="hidden"], script[src]').length, 0);
assert.equal($('#consultation-heading').text(), 'Contact AIA about early intervention');
assert.equal($('#consultation input').length, 3);
assert.equal($('#consultation input:disabled').length, 3);
assert.equal($('#consultation').attr('data-forms-mode'), 'off');
assert.equal($('#consultation [data-jotform-form-a]').length, 0);
assert.equal($('#consultation button').attr('type'), 'button');
const live = $('#consultation [data-jotform-form-a]').length === 1;
assert.equal($('#consultation').attr('data-forms-mode'), live ? 'live' : 'off');
if (live) {
assert.equal($('#consultation input').length, 0);
assert.equal($('#consultation iframe').attr('src'), 'https://form.jotform.com/262946078314059?formContext=landing&language=en');
} else {
assert.equal($('#consultation input:disabled').length, 3);
assert.equal($('#consultation button').attr('type'), 'button');
}
assert.ok($('.qr-call-card a[href="tel:+14806877099"]').length);
assert.equal($('#consultation-unavailable, [data-form-status-notice]').length, 0);
assert.equal($('img[src^="https:"]').length, 0);