Skip to content
Snippets Groups Projects

Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers

Open Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers
2 unresolved threads
Open Ben Mullins requested to merge issue/drupal-2845319:2845319-the-highlighting-of into 9.3.x
2 unresolved threads
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
@@ -20,7 +20,7 @@ class ContextualDynamicContextTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'classy';
protected $defaultTheme = 'stark';
/**
* A user with permission to access contextual links and edit content.
@@ -115,9 +115,9 @@ public function testDifferentPermissions() {
$response = $this->renderContextualLinks($ids, 'node');
$this->assertSame(200, $response->getStatusCode());
$json = Json::decode((string) $response->getBody());
$this->assertSame('<ul class="contextual-links"><li class="entitynodeedit-form"><a href="' . base_path() . 'node/1/edit">Edit</a></li></ul>', $json[$ids[0]]);
$this->assertSame('<ul class="contextual-links"><li><a href="' . base_path() . 'node/1/edit">Edit</a></li></ul>', $json[$ids[0]]);
$this->assertSame('', $json[$ids[1]]);
$this->assertSame('<ul class="contextual-links"><li class="entitynodeedit-form"><a href="' . base_path() . 'node/3/edit">Edit</a></li></ul>', $json[$ids[2]]);
$this->assertSame('<ul class="contextual-links"><li><a href="' . base_path() . 'node/3/edit">Edit</a></li></ul>', $json[$ids[2]]);
$this->assertSame('', $json[$ids[3]]);
// Verify that link language is properly handled.
@@ -157,7 +157,7 @@ public function testDifferentPermissions() {
// Get a page where contextual links are directly rendered.
$this->drupalGet(Url::fromRoute('menu_test.contextual_test'));
$this->assertSession()->assertEscaped("<script>alert('Welcome to the jungle!')</script>");
$this->assertSession()->responseContains('<li class="menu-testcontextual-hidden-manage-edit"><a href="' . base_path() . 'menu-test-contextual/1/edit" class="use-ajax" data-dialog-type="modal" data-is-something>Edit menu - contextual</a></li>');
$this->assertSession()->responseContains('<li><a href="' . base_path() . 'menu-test-contextual/1/edit" class="use-ajax" data-dialog-type="modal" data-is-something>Edit menu - contextual</a></li>');
}
/**
Loading