[MQ-109] tests text block can be added to editor

This commit is contained in:
Michelle Shull
2019-04-11 17:13:32 -04:00
committed by M. Shull
parent a8584523d3
commit 3fbdd861b2
3 changed files with 31 additions and 1 deletions

View File

@ -80,6 +80,7 @@ Module.TextBlockSettingsView = base.BlockSettingsView.extend({
});
Module.TextWidgetView = base.WidgetView.extend({
id: 'automation_editor_block_text',
getTemplate: function getTemplate() { return window.templates.textInsertion; },
behaviors: {
DraggableBehavior: {

View File

@ -0,0 +1,29 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
require_once __DIR__ . '/../DataFactories/Newsletter.php';
class EditorTextBlockCest {
function addText(\AcceptanceTester $I) {
$I->wantTo('add Text block to newsletter');
$newsletterTitle = 'Text Block Newsletter';
$textInEditor = ('[data-automation-id="text_block_in_editor"]');
(new Newsletter())
->withSubject($newsletterTitle)
->loadBodyFrom('newsletterWithText.json')
->create();
$I->login();
$I->amOnMailpoetPage('Emails');
$I->waitForText($newsletterTitle);
$I->clickItemRowActionByItemName($newsletterTitle, 'Edit');
// Create Text block
$I->waitForText('Text');
$I->wait(1); // just to be sure
$I->dragAndDrop('#automation_editor_block_text', '#mce_1');
$I->waitForText('Edit this to insert text.');
}
}

View File

@ -1,5 +1,5 @@
<div class="mailpoet_tools"></div>
<div class="mailpoet_content mailpoet_text_content">
<div class="mailpoet_content mailpoet_text_content" data-automation-id="text_block_in_editor">
{{{ model.text }}}
</div>
<div class="mailpoet_block_highlight"></div>