Issue #2938309 by tedbow, tacituseu, Wim Leers: Only install Quick Edit when necessary for Settings Tray tests
parent
6f8bc7b1cf
commit
e1a7b35c41
|
|
@ -11,6 +11,7 @@ use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock;
|
||||||
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
|
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
|
||||||
use Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase;
|
use Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase;
|
||||||
use Drupal\user\Entity\Role;
|
use Drupal\user\Entity\Role;
|
||||||
|
use Drupal\user\RoleInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testing opening and saving block forms in the off-canvas dialog.
|
* Testing opening and saving block forms in the off-canvas dialog.
|
||||||
|
|
@ -36,7 +37,6 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
|
||||||
'toolbar',
|
'toolbar',
|
||||||
'contextual',
|
'contextual',
|
||||||
'settings_tray',
|
'settings_tray',
|
||||||
'quickedit',
|
|
||||||
'search',
|
'search',
|
||||||
'block_content',
|
'block_content',
|
||||||
'settings_tray_test',
|
'settings_tray_test',
|
||||||
|
|
@ -62,7 +62,6 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
|
||||||
'access contextual links',
|
'access contextual links',
|
||||||
'access toolbar',
|
'access toolbar',
|
||||||
'administer nodes',
|
'administer nodes',
|
||||||
'access in-place editing',
|
|
||||||
'search content',
|
'search content',
|
||||||
]);
|
]);
|
||||||
$this->drupalLogin($user);
|
$this->drupalLogin($user);
|
||||||
|
|
@ -294,6 +293,8 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
|
||||||
* Tests QuickEdit links behavior.
|
* Tests QuickEdit links behavior.
|
||||||
*/
|
*/
|
||||||
public function testQuickEditLinks() {
|
public function testQuickEditLinks() {
|
||||||
|
$this->container->get('module_installer')->install(['quickedit']);
|
||||||
|
$this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']);
|
||||||
$quick_edit_selector = '#quickedit-entity-toolbar';
|
$quick_edit_selector = '#quickedit-entity-toolbar';
|
||||||
$node_selector = '[data-quickedit-entity-id="node/1"]';
|
$node_selector = '[data-quickedit-entity-id="node/1"]';
|
||||||
$body_selector = '[data-quickedit-field-id="node/1/body/en/full"]';
|
$body_selector = '[data-quickedit-field-id="node/1/body/en/full"]';
|
||||||
|
|
@ -511,6 +512,8 @@ class SettingsTrayBlockFormTest extends OffCanvasTestBase {
|
||||||
* "Quick edit settings" is settings_tray.module link.
|
* "Quick edit settings" is settings_tray.module link.
|
||||||
*/
|
*/
|
||||||
public function testCustomBlockLinks() {
|
public function testCustomBlockLinks() {
|
||||||
|
$this->container->get('module_installer')->install(['quickedit']);
|
||||||
|
$this->grantPermissions(Role::load(RoleInterface::AUTHENTICATED_ID), ['access in-place editing']);
|
||||||
$this->drupalGet('user');
|
$this->drupalGet('user');
|
||||||
$page = $this->getSession()->getPage();
|
$page = $this->getSession()->getPage();
|
||||||
$links = $page->findAll('css', "#block-custom .contextual-links li a");
|
$links = $page->findAll('css', "#block-custom .contextual-links li a");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue