You are here

WebformElementVerticalTabsTest.php in Webform 8.5

Same filename and directory in other branches
  1. 6.x tests/src/Functional/Element/WebformElementVerticalTabsTest.php

File

tests/src/Functional/Element/WebformElementVerticalTabsTest.php
View source
<?php

namespace Drupal\Tests\webform\Functional\Element;


/**
 * Tests for vertical tabs element.
 *
 * @group webform
 */
class WebformElementVerticalTabsTest extends WebformElementBrowserTestBase {

  /**
   * Webforms to load.
   *
   * @var array
   */
  protected static $testWebforms = [
    'test_element_vertical_tabs',
  ];

  /**
   * Test vertical tabs element.
   */
  public function testVerticalTabs() {
    $this
      ->drupalGet('/webform/test_element_vertical_tabs');

    // Check vertical_tabs element.
    $this
      ->assertRaw('<div data-drupal-selector="edit-vertical-tabs" data-vertical-tabs-panes>');
    $this
      ->assertRaw('<input class="vertical-tabs__active-tab" data-drupal-selector="edit-vertical-tabs-active-tab" type="hidden" name="vertical_tabs__active_tab" value="" />');

    // Check vertical_tabs advanced element.
    $this
      ->assertRaw('<div data-drupal-selector="edit-vertical-tabs-advanced" aria-describedby="edit-vertical-tabs-advanced--description" data-vertical-tabs-panes>');
    $this
      ->assertRaw('<input class="vertical-tabs__active-tab" data-drupal-selector="edit-vertical-tabs-advanced-active-tab" type="hidden" name="vertical_tabs_advanced__active_tab" value="edit-vertical-tabs-advanced-details-03" />');
  }

}

Classes

Namesort descending Description
WebformElementVerticalTabsTest Tests for vertical tabs element.