Skip to content
Snippets Groups Projects
Commit d05e452f authored by Ben Mullins's avatar Ben Mullins
Browse files

Issue #2991686 by smustgrave, larowlan, Grayle: Enabling "Edit" to show all...

Issue #2991686 by smustgrave, larowlan, Grayle: Enabling "Edit" to show all contextual links breaks tabbing in edit forms in the backend
parent f4fc5940
No related branches found
No related tags found
4 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber
......@@ -32,8 +32,9 @@
// rather than view mode.
// @see Drupal.contextualToolbar.VisualView.persist
isViewing:
document.querySelector('body .contextual-region') === null ||
localStorage.getItem('Drupal.contextualToolbar.isViewing') !==
'false',
'false',
},
{
contextualCollection: Drupal.contextual.collection,
......
......@@ -34,16 +34,30 @@ class EditModeTest extends WebDriverTestBase {
*/
protected $defaultTheme = 'stark';
/**
* The administration theme name.
*
* @var string
*/
protected $adminTheme = 'claro';
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
\Drupal::service('theme_installer')->install([$this->adminTheme]);
\Drupal::configFactory()
->getEditable('system.theme')
->set('admin', $this->adminTheme)
->save();
$this->drupalLogin($this->createUser([
'administer blocks',
'access contextual links',
'access toolbar',
'view the administration theme',
]));
$this->placeBlock('system_powered_by_block', ['id' => 'powered']);
}
......@@ -86,6 +100,13 @@ public function testEditModeEnableDisable() {
// correct after toggling the edit mode at least once.
$this->assertAnnounceEditMode();
$this->assertSame($expected_restricted_tab_count, $this->getTabbableElementsCount());
// Test while Edit Mode is enabled it doesn't interfere with pages with
// no contextual links.
$this->drupalGet('admin/structure/block');
$web_assert->elementContains('css', 'h1.page-title', 'Block layout');
$this->assertEquals(0, count($page->findAll('css', '[data-contextual-id]')));
$this->assertGreaterThan(0, $this->getTabbableElementsCount());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment