3 namespace Drupal\Tests\system\Functional\Form;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests the container form element for expected behavior.
12 class ElementsContainerTest extends BrowserTestBase {
19 public static $modules = ['form_test'];
22 * Tests the #optional container property.
24 public function testOptionalContainerElements() {
25 $this->drupalGet('form-test/optional-container');
26 $assertSession = $this->assertSession();
27 $assertSession->elementNotExists('css', 'div.empty_optional');
28 $assertSession->elementExists('css', 'div.empty_nonoptional');
29 $assertSession->elementExists('css', 'div.nonempty_optional');
30 $assertSession->elementExists('css', 'div.nonempty_nonoptional');