fix public.js not included when only shortcode is used

This commit is contained in:
Amine Ben hammou
2017-12-28 14:20:30 +00:00
committed by Pavel Dohnal
parent 6f20a402f6
commit d70c6ce453
2 changed files with 12 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class Widget extends \WP_Widget {
}
function setupDependencies() {
if(!is_active_widget(false, false, $this->id_base, true)) return;
if(wp_script_is('mailpoet_public', 'enqueued')) return;
wp_enqueue_style(
'mailpoet_public',

View File

@ -25,6 +25,17 @@ class SubscriptionFormCest {
$I->cli('widget reset sidebar-1 --allow-root');
}
function subscriptionFormShortcode(\AcceptanceTester $I) {
$I->wantTo('Subscribe using form shortcode');
$I->amOnPage('/form-test');
$I->fillField('[data-automation-id=\'form_email\']', $this->subscriber_email);
$I->click('.mailpoet_submit');
$I->waitForText('Check your inbox or spam folder to confirm your subscription.', self::CONFIRMATION_MESSAGE_TIMEOUT, '.mailpoet_validate_success');
$I->seeNoJSErrors();
$I->seeCurrentUrlEquals('/form-test');
}
function subscriptionFormIframe(\AcceptanceTester $I) {
$I->wantTo('Subscribe using iframe form');