Add acceptance test for email and submit editing
[MAILPOET-2451]
This commit is contained in:
committed by
Jack Kitterhing
parent
270798ceeb
commit
e9ee0323d3
@@ -17,6 +17,7 @@ const EmailEdit = ({ attributes, setAttributes }) => {
|
||||
<TextControl
|
||||
label={MailPoet.I18n.t('label')}
|
||||
value={attributes.label}
|
||||
data-automation-id="settings_email_label_input"
|
||||
onChange={(label) => (setAttributes({ label }))}
|
||||
/>
|
||||
<ToggleControl
|
||||
@@ -29,16 +30,27 @@ const EmailEdit = ({ attributes, setAttributes }) => {
|
||||
|
||||
</InspectorControls>
|
||||
);
|
||||
|
||||
const getTextInput = (placeholder) => (
|
||||
<input
|
||||
id="email"
|
||||
className="mailpoet_text"
|
||||
type="email"
|
||||
name="name"
|
||||
placeholder={placeholder}
|
||||
data-automation-id="editor_email_input"
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{inspectorControls}
|
||||
{attributes.labelWithinInput ? (
|
||||
<input className="mailpoet_text" type="email" name="name" placeholder={attributes.label} />
|
||||
{attributes.labelWithinInput ? (getTextInput(attributes.label)
|
||||
) : (
|
||||
<label className="mailpoet_text_label">
|
||||
<label className="mailpoet_text_label" data-automation-id="editor_email_label" htmlFor="email">
|
||||
{attributes.label}
|
||||
<br />
|
||||
<input className="mailpoet_text" type="email" name="email" placeholder="" />
|
||||
{getTextInput('')}
|
||||
</label>
|
||||
)}
|
||||
</>
|
||||
|
@@ -14,6 +14,7 @@ const SubmitEdit = ({ attributes, setAttributes }) => {
|
||||
label={MailPoet.I18n.t('label')}
|
||||
value={attributes.label}
|
||||
onChange={(label) => (setAttributes({ label }))}
|
||||
data-automation-id="settings_submit_label_input"
|
||||
/>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
@@ -25,7 +26,12 @@ const SubmitEdit = ({ attributes, setAttributes }) => {
|
||||
<>
|
||||
{ inspectorControls }
|
||||
<div className="mailpoet_submit">
|
||||
<input className="button" type="submit" value={attributes.label} />
|
||||
<input
|
||||
className="button"
|
||||
type="submit"
|
||||
value={attributes.label}
|
||||
data-automation-id="editor_submit_input"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
Reference in New Issue
Block a user