function ClaroEntityDisplayTest::testEntityForm

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testEntityForm()
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testEntityForm()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testEntityForm()

Copied from parent.

This is Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest::testEntityForm() with a line changed to reflect row weight toggle being a link instead of a button.

Overrides EntityDisplayTest::testEntityForm

File

core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php, line 43

Class

ClaroEntityDisplayTest
Runs EntityDisplayTest in Claro.

Namespace

Drupal\FunctionalJavascriptTests\Theme

Code

public function testEntityForm() {
    $this->drupalGet('entity_test/manage/1/edit');
    $this->assertSession()
        ->fieldExists('field_test_text[0][value]');
    $this->drupalGet('entity_test/structure/entity_test/form-display');
    $this->assertTrue($this->assertSession()
        ->optionExists('fields[field_test_text][region]', 'content')
        ->isSelected());
    $this->getSession()
        ->getPage()
        ->clickLink('Show row weights');
    $this->assertSession()
        ->waitForElementVisible('css', '[name="fields[field_test_text][region]"]');
    $this->getSession()
        ->getPage()
        ->selectFieldOption('fields[field_test_text][region]', 'hidden');
    $this->assertSession()
        ->assertWaitOnAjaxRequest();
    $this->assertTrue($this->assertSession()
        ->optionExists('fields[field_test_text][region]', 'hidden')
        ->isSelected());
    $this->submitForm([], 'Save');
    $this->assertSession()
        ->pageTextContains('Your settings have been saved.');
    $this->assertTrue($this->assertSession()
        ->optionExists('fields[field_test_text][region]', 'hidden')
        ->isSelected());
    $this->drupalGet('entity_test/manage/1/edit');
    $this->assertSession()
        ->fieldNotExists('field_test_text[0][value]');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.