WebformElementDetailsTest.php in Webform 8.5
File
tests/src/Functional/Element/WebformElementDetailsTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Element;
class WebformElementDetailsTest extends WebformElementBrowserTestBase {
protected static $testWebforms = [
'test_element_details',
];
public function testDetails() {
$this
->drupalGet('/webform/test_element_details');
$this
->assertRaw('<details data-webform-key="details" data-drupal-selector="edit-details" aria-describedby="edit-details--description" id="edit-details" class="js-form-wrapper form-wrapper required webform-element-help-container--title webform-element-help-container--title-after" open="open">');
$this
->assertRaw('<summary role="button" aria-controls="edit-details" aria-expanded="true" aria-pressed="true" class="js-form-required form-required">details<span class="webform-element-help js-webform-element-help" role="tooltip" tabindex="0" aria-label="details" data-webform-help="<div class="webform-element-help--title">details</div><div class="webform-element-help--content">This is help text.</div>"><span aria-hidden="true">?</span>');
$this
->assertRaw('<div id="edit-details--description" class="webform-element-description">This is a description.</div>');
$this
->assertRaw('<div id="edit-details--more" class="js-webform-element-more webform-element-more">');
$this
->assertRaw('<summary role="button" aria-controls="edit-details-title-invisible" aria-expanded="false" aria-pressed="false"><span class="visually-hidden">Details title invisible</span></summary>');
}
}