diff --git a/recipes/drupal_cms_forms/config/webform.webform.contact_form.yml b/recipes/drupal_cms_forms/config/webform.webform.contact_form.yml index ec27882ef3d77c2f0ff89850eaa305ae09b9dfd2..654c6f730eb5e6179d31face5c7d7f00b99c551e 100644 --- a/recipes/drupal_cms_forms/config/webform.webform.contact_form.yml +++ b/recipes/drupal_cms_forms/config/webform.webform.contact_form.yml @@ -9,8 +9,6 @@ third_party_settings: antibot: true honeypot: honeypot: true -_core: - default_config_hash: Fcw7hXWj_zgosggPLJsVnXVpfHDrnjSh7rv8a_EhoVI weight: 0 open: null close: null diff --git a/recipes/drupal_cms_forms/tests/e2e/contact_form.cy.js b/recipes/drupal_cms_forms/tests/e2e/contact_form.cy.js index 8dcf40a569f9428868bd1c256437fd4ba1eb4633..48c00483f8b920f69c81cbe67fd1670b297dcb9e 100644 --- a/recipes/drupal_cms_forms/tests/e2e/contact_form.cy.js +++ b/recipes/drupal_cms_forms/tests/e2e/contact_form.cy.js @@ -1,33 +1,33 @@ describe('Contact form', () => { beforeEach(() => { - cy.setUp('standard').applyRecipe().visit('/contact'); + cy.setUp('standard').applyRecipe(); }); after(() => { cy.tearDown(); }); - it('appears in the main menu', () => { + it('requires all fields and has spam protection', () => { // Ensure the viewport is wide enough to see the main menu links. cy.viewport('macbook-13'); - cy.findByText('Main navigation').parent().find('a:contains("Contact")'); - }); + // Use the main menu link to visit the contact form. + cy.findByText('Main navigation') + .parent() + .find('a:contains("Contact")') + .click(); - it('requires all fields', () => { - cy.findByLabelText('Name').should('have.attr', 'required'); - cy.findByLabelText('Email').should('have.attr', 'required'); - cy.findByLabelText('Message').should('have.attr', 'required'); - cy.findByText('CAPTCHA', { selector: 'fieldset > legend' }).should('exist'); - }); + cy.get('[id^"=webform-submission-contact-form-node-"]').within(() => { + cy.findByLabelText('Name').should('have.attr', 'required'); + cy.findByLabelText('Email').should('have.attr', 'required'); + cy.findByLabelText('Message').should('have.attr', 'required'); + cy.findByText('CAPTCHA', { selector: 'fieldset > legend' }) + .should('exist') + .findByText('Click to start verification') + .should('exist'); - it('has spam protection', () => { - // Confirm the Antibot, Honeypot and Friendly CAPTCHA fields exist within the form. - cy.get('[id^=webform-submission-contact-form-node]').within(() => { cy.get('input[type="hidden"][name="antibot_key"]').should('exist'); cy.get('input[name="url"]').should('not.be.visible'); - // Confirm the friendly CAPTCHA is present. - cy.findByText('Click to start verification').should('exist'); }); });