Skip to content
Snippets Groups Projects

Remove the language block navigation role

Open David Cameron requested to merge issue/drupal-3319633:3319633-language-block-role into 11.x
2 files
+ 21
9
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -84,6 +84,7 @@ public function testLanguageBlock(): void {
]);
$this->doTestLanguageBlockAuthenticated($block->label());
$this->doTestLanguageBlockRole($block->label());
$this->doTestHomePageLinks($block->label());
$this->doTestLanguageBlockAnonymous($block->label());
$this->doTestLanguageBlock404($block->label(), 'system/404');
@@ -211,6 +212,26 @@ protected function doTestLanguageBlockAuthenticated($block_label): void {
$this->assertSame(['English', 'français'], $labels, 'The language links labels are in their own language on the language switcher block.');
}
/**
* Verifies that the block does not have the navigation role attribute.
*
* @param string $block_label
* The label of the language switching block.
*
* @see self::testLanguageBlock()
*/
protected function doTestLanguageBlockRole($block_label): void {
// Assert that the language switching block is displayed on the frontpage.
$this->drupalGet('');
$this->assertSession()->pageTextContains($block_label);
$block = $this->xpath('//div[@id=:id][not(@role=:role)]', [
':id' => 'block-test-language-block',
':role' => 'navigation',
]);
$this->assertCount(1, $block);
}
/**
* For anonymous users, the "active" class is set by PHP.
*
Loading