diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php index 7f3665a..dfb133e 100644 --- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php @@ -288,8 +288,13 @@ public function testBlockContextualLinks() { $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page'))); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json[$id], '
'); - $this->assertIdentical($json[$cached_id], ''); + $this->setRawContent($json[$id]); + $result = $this->xpath('//ul/li/a[contains(@href, :block) and text()="Configure block"]', [':block' => "admin/structure/block/manage/" . $block->id()]); + $this->assertTrue($result, 'The contextual links are present.'); + $this->setRawContent($json[$cached_id]); + $result = $this->xpath('//ul/li/a[contains(@href, :cached_block) and text()="Configure block"]', [':cached_block' => "admin/structure/block/manage/" . $cached_block->id()]); + $this->assertTrue($result, 'The contextual links are present.'); + } } diff --git a/core/modules/system/templates/links.html.twig b/core/modules/system/templates/links.html.twig index 21ab95d..479f0dd 100644 --- a/core/modules/system/templates/links.html.twig +++ b/core/modules/system/templates/links.html.twig @@ -36,25 +36,25 @@ * @ingroup themeable */ #} -{% if links -%} - {%- if heading -%} - {%- if heading.level -%} +{% if links %} + {% if heading %} + {% if heading.level %} <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }}{{ heading.level }}> - {%- else -%} + {% else %}