Only render Live editor save button when content type is set #6182

Merged
merged 2 commits into from Dec 19, 2016

Projects

None yet

2 participants

@roggan87
Contributor

This PR is a follow up on #6178. Instead of trying to render the save button on every page in the back-end, only try when we're actually editing content. Otherwise Bolt will break since no contenttype is set.

@GawainLynch
Member

That moment you look at the test failures and go; "Whaaaaaaaaaaaaat the?!"

I'll have a dig for you.

@GawainLynch
Member

This will get your tests passing:

diff --git a/tests/codeception/acceptance/101-BackendEditor/BackendEditorCest.php b/tests/codeception/acceptance/101-BackendEditor/BackendEditorCest.php
index a6b0b96..7538160 100644
--- a/tests/codeception/acceptance/101-BackendEditor/BackendEditorCest.php
+++ b/tests/codeception/acceptance/101-BackendEditor/BackendEditorCest.php
@@ -82,7 +82,7 @@ class BackendEditorCest extends AbstractAcceptanceTest
         $I->fillField('#teaser', 'Woop woop woop! Crazy nice stuff inside!');
         $I->fillField('#body',   'Take it, take it! I have three more of these!');
 
-        $I->click('Save Page');
+        $I->click('Save Page', '#savecontinuebutton');
         $I->see('The new Page has been saved.');
 
         $I->see('A page I made');
@@ -232,7 +232,7 @@ class BackendEditorCest extends AbstractAcceptanceTest
         $I->see('Template', 'a[data-toggle=tab]');
 
         $I->fillField('#templatefields-section_1', 'This is the contact text');
-        $I->click('Save Page');
+        $I->click('Save Page', '#savecontinuebutton');
 
         $I->click('CONTACT PAGE');
         /*
@roggan87
Contributor

Thanks @GawainLynch! I'm not too familiar with testing, so I guess I have some reading up to do.

@GawainLynch
Member

👍

@GawainLynch GawainLynch merged commit f9983ce into bolt:release/3.2 Dec 19, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment