You are here

public function QueueEmptyFormTest::testNo in Purge 8.3

Tests that the "No" cancel button closes the dialog.

See also

\Drupal\purge_ui\Form\QueuerDeleteForm::buildForm

\Drupal\purge_ui\Form\CloseDialogTrait::closeDialog

File

modules/purge_ui/tests/src/Functional/Form/QueueEmptyFormTest.php, line 71

Class

QueueEmptyFormTest
Tests \Drupal\purge_ui\Form\QueueEmptyForm.

Namespace

Drupal\Tests\purge_ui\Functional\Form

Code

public function testNo() : void {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet($this
    ->getPath());
  $this
    ->assertSession()
    ->responseContains('No');
  $ajax = $this
    ->postAjaxForm([], 'No');
  $this
    ->assertAjaxCommandCloseModalDialog($ajax);
  $this
    ->assertAjaxCommandsTotal($ajax, 1);
}