Add acceptance test for form preview

[MAILPOET-2743]
This commit is contained in:
Rostislav Wolny
2020-04-16 18:30:52 +02:00
committed by Veljko V
parent 4cb7ba2424
commit 6d07f5eb32
4 changed files with 58 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ function Preview({
}}
title={MailPoet.I18n.t('formPreviewDesktop')}
href="#"
data-automation-id="preview_type_desktop"
>
<DesktopIcon />
</a>
@@ -37,6 +38,7 @@ function Preview({
}}
title={MailPoet.I18n.t('formPreviewMobile')}
href="#"
data-automation-id="preview_type_mobile"
>
<MobileIcon />
</a>

View File

@@ -28,6 +28,7 @@ export default () => {
onClick={showPreview}
isPressed={isPreview}
className="editor-post-preview"
data-automation-id="form_preview_button"
>
{__('Preview')}
</Button>

View File

@@ -132,6 +132,7 @@ const FormPreview = () => {
<select
onChange={onChange(setFormType)}
value={formType}
data-automation-id="form_type_selection"
>
<option value="sidebar">{MailPoet.I18n.t('placeFormSidebar')}</option>
<option value="below_post">{MailPoet.I18n.t('placeFormBellowPages')}</option>
@@ -155,6 +156,7 @@ const FormPreview = () => {
src={iframeSrc}
title={MailPoet.I18n.t('formPreview')}
onLoad={() => setIframeLoaded(true)}
data-automation-id="form_preview_iframe"
/>
</Preview>
</>