Verified Commit b72a2b11 authored by alexpott's avatar alexpott
Browse files

Issue #2314443 by olli, Lendude, immaculatexavier, dawehner: Changing view...

Issue #2314443 by olli, Lendude, immaculatexavier, dawehner: Changing view name does not update page title in views ui

(cherry picked from commit fe3be7e1)
parent 78d9626f
......@@ -34,7 +34,8 @@ public function __construct($title) {
public function render() {
return [
'command' => 'viewsReplaceTitle',
'selector' => $this->title,
'title' => $this->title,
'siteName' => \Drupal::config('system.site')->get('name'),
];
}
......
......@@ -81,6 +81,28 @@ public function testAddDisplay() {
$this->assertNotEmpty($element);
}
/**
* Tests setting the administrative title.
*/
public function testRenameDisplayAdminName() {
$titles = ['New admin title', '</title><script>alert("alert!")</script>'];
foreach ($titles as $new_title) {
$this->drupalGet('admin/structure/views/view/test_content_ajax');
$page = $this->getSession()->getPage();
$page->findLink('Edit view name/description')->click();
$this->getSession()->executeScript("document.title = 'Initial title | " . \Drupal::config('system.site')->get('name') . "'");
$admin_name_field = $this->assertSession()
->waitForField('Administrative name');
$dialog_buttons = $page->find('css', '.ui-dialog-buttonset');
$admin_name_field->setValue($new_title);
$dialog_buttons->pressButton('Apply');
$this->assertJsCondition("document.title === '" . $new_title . " (Content) | " . \Drupal::config('system.site')->get('name') . "'");
}
}
/**
* Tests contextual links on Views page displays.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment