You are here

public function PurgerDetailsFormTest::testDetailForm in Purge 8.3

Tests that the close button works and that content exists.

See also

\Drupal\purge_ui\Form\PurgerDetailForm::buildForm

\Drupal\purge_ui\Form\CloseDialogTrait::closeDialog

File

modules/purge_ui/tests/src/Functional/Form/PurgerDetailsFormTest.php, line 63

Class

PurgerDetailsFormTest
Tests \Drupal\purge_ui\Form\PluginDetailsForm (for purgers).

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testDetailForm() : void {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->responseContains('Purger A');
  $this
    ->assertSession()
    ->responseContains('Test purger A.');
  $this
    ->assertSession()
    ->responseContains('Close');
  $ajax = $this
    ->postAjaxForm([], 'Close');
  $this
    ->assertAjaxCommandCloseModalDialog($ajax);
  $this
    ->assertAjaxCommandsTotal($ajax, 1);
}