You are here

public function ConfigPageTest::testRequireOnPublishEnable in Require on Publish 8

Test that the 'Required on Publish' field can be succesfully enabled.

File

tests/src/FunctionalJavascript/ConfigPageTest.php, line 118

Class

ConfigPageTest
Tests the 'Require on Publish' functionality on field config pages.

Namespace

Drupal\Tests\require_on_publish\FunctionalJavascript

Code

public function testRequireOnPublishEnable() {
  $this
    ->logIn();

  // Set 'Required on Publish'.
  $this
    ->getSession()
    ->getPage()
    ->fillField('require_on_publish', 1);

  // Save.
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save settings');

  // Ensure 'Required on Publish' is true.
  $required = $this
    ->getSession()
    ->getPage()
    ->findField('require_on_publish')
    ->getValue();
  $this
    ->assertEquals(1, $required);
}