diff --git a/assets/js/src/form_editor/blocks/blocks.jsx b/assets/js/src/form_editor/blocks/blocks.jsx index 73377d9785..21049f2955 100644 --- a/assets/js/src/form_editor/blocks/blocks.jsx +++ b/assets/js/src/form_editor/blocks/blocks.jsx @@ -29,9 +29,8 @@ export const initBlocks = () => { const categories = [ { slug: 'obligatory', title: '' }, // Blocks from this category are not in block insert popup ]; - if (Array.isArray(customFields) && customFields.length) { - categories.push({ slug: 'custom-fields', title: MailPoet.I18n.t('customFieldsBlocksCategory') }); - } + + categories.push({ slug: 'custom-fields', title: MailPoet.I18n.t('customFieldsBlocksCategory') }); categories.push({ slug: 'fields', title: MailPoet.I18n.t('fieldsBlocksCategory') }); setCategories(categories); diff --git a/tests/acceptance/FormEditorAddNamesCest.php b/tests/acceptance/FormEditorAddNamesCest.php index f31eff79c3..c7615ee1aa 100644 --- a/tests/acceptance/FormEditorAddNamesCest.php +++ b/tests/acceptance/FormEditorAddNamesCest.php @@ -27,11 +27,11 @@ class FormEditorAddNamesCest { $i->click('.block-list-appender button');// CLICK the big button that adds new blocks $i->waitForElement('.editor-inserter__results .components-panel__body-toggle'); - $i->click('.editor-inserter__results .components-panel__body-toggle'); // toggle fields + $i->click('.editor-inserter__results .components-panel__body:nth-child(2) .components-panel__body-toggle'); // toggle fields $i->click('.editor-block-list-item-mailpoet-form-first-name-input'); // add first name block to the editor $i->click('.block-list-appender button');// CLICK the big button that adds new blocks $i->waitForElement('.editor-inserter__results .components-panel__body-toggle'); - $i->click('.editor-inserter__results div:nth-child(2) .components-panel__body-toggle'); // toggle fields, get the second field, first one is now "Most Used" + $i->click('.editor-inserter__results .components-panel__body:nth-child(3) .components-panel__body-toggle'); // toggle fields, get the second field, first one is now "Most Used" $i->click('.editor-block-list-item-mailpoet-form-last-name-input'); // add last name block to the editor $i->click('[data-automation-id="form_save_button"]');