diff --git a/core/modules/views_ui/src/Tests/AreaUITest.php b/core/modules/views_ui/src/Tests/AreaUITest.php new file mode 100644 index 0000000..bf7486d --- /dev/null +++ b/core/modules/views_ui/src/Tests/AreaUITest.php @@ -0,0 +1,42 @@ +randomView([]); + $id = $default['id']; + $view = View::load($id); + + $type = $this->drupalCreateContentType()->id(); + $this->drupalCreateNode(array('type' => $type)); + + $this->drupalGet($view->urlInfo('edit-form')); + + // Configure the area header. + $this->drupalPostForm("admin/structure/views/nojs/add-handler/$id/page_1/header", ['name[views.area_text_custom]' => 1], 'Add and configure header'); + $this->drupalPostForm(NULL, ['options[empty]' => 'checked' , 'options[tokenize]' => 'checked', 'options[content]' => '{% if title %} This is the title: {{ title }} {% endif %}'], 'Apply'); + $this->drupalGet("/admin/structure/views/nojs/display/$id/page_1/row"); + $this->drupalPostForm(NULL, ['row[type]' => 'fields'], 'Apply'); + $this->drupalPostForm(NULL, [], 'Apply'); + $this->drupalPostForm(NULL, [], 'Save'); + + $this->drupalGet($id); + $this->assertText(t('This is the title')); + $this->assertNoText(t('{% endif %}')); + + } + +}