From 3fbdd861b2373d9139f7adf44b41f51d16e3d8c5 Mon Sep 17 00:00:00 2001 From: Michelle Shull Date: Thu, 11 Apr 2019 17:13:32 -0400 Subject: [PATCH] [MQ-109] tests text block can be added to editor --- .../js/src/newsletter_editor/blocks/text.js | 1 + tests/acceptance/EditorTextBlockCest.php | 29 +++++++++++++++++++ .../templates/blocks/text/block.hbs | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/acceptance/EditorTextBlockCest.php diff --git a/assets/js/src/newsletter_editor/blocks/text.js b/assets/js/src/newsletter_editor/blocks/text.js index 9326f18589..676903b94d 100644 --- a/assets/js/src/newsletter_editor/blocks/text.js +++ b/assets/js/src/newsletter_editor/blocks/text.js @@ -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: { diff --git a/tests/acceptance/EditorTextBlockCest.php b/tests/acceptance/EditorTextBlockCest.php new file mode 100644 index 0000000000..2a03cc2b37 --- /dev/null +++ b/tests/acceptance/EditorTextBlockCest.php @@ -0,0 +1,29 @@ +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.'); + } + +} diff --git a/views/newsletter/templates/blocks/text/block.hbs b/views/newsletter/templates/blocks/text/block.hbs index 5440840d6c..07a337e248 100644 --- a/views/newsletter/templates/blocks/text/block.hbs +++ b/views/newsletter/templates/blocks/text/block.hbs @@ -1,5 +1,5 @@
-
+
{{{ model.text }}}