function HtmxDynamicFormTest::testPartialDelete
Verify that an hx-partial response with a delete swap removes the target.
File
-
core/
tests/ Drupal/ FunctionalJavascriptTests/ Core/ Htmx/ HtmxDynamicFormTest.php, line 161
Class
- HtmxDynamicFormTest
- Tests that dynamic forms powered by HTMX work as expected.
Namespace
Drupal\FunctionalJavascriptTests\Core\HtmxCode
public function testPartialDelete() : void {
$this->drupalLogin($this->drupalCreateUser([
'access content',
]));
$this->drupalGet('htmx-test-attachments/form-builder-test/');
$this->assertSession()
->elementExists('css', '[data-drupal-wrapper-selector="edit-partial-replace"]');
$checkbox = $this->assertSession()
->elementExists('css', '[name="partial_delete"]');
$checkbox->click();
$this->assertSession()
->assertWaitOnAjaxRequest();
$this->assertSession()
->elementNotExists('css', '[data-drupal-wrapper-selector="edit-partial-replace"]');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.