X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FFunctionalJavascriptTests%2FAjax%2FAjaxTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FFunctionalJavascriptTests%2FAjax%2FAjaxTest.php;h=5d11ce49b4bc758fffdb8864cc3af79f94d4b94d;hp=e05940537c4730e752b2dbe3ff0fe5abd6d86a86;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c
diff --git a/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php b/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
index e05940537..5d11ce49b 100644
--- a/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
+++ b/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
@@ -2,14 +2,14 @@
namespace Drupal\FunctionalJavascriptTests\Ajax;
-use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
/**
* Tests AJAX responses.
*
* @group Ajax
*/
-class AjaxTest extends JavascriptTestBase {
+class AjaxTest extends WebDriverTestBase {
/**
* {@inheritdoc}
@@ -82,4 +82,119 @@ class AjaxTest extends JavascriptTestBase {
$this->assertNotContains($fake_library, $libraries);
}
+ /**
+ * Tests that various AJAX responses with DOM elements are correctly inserted.
+ *
+ * After inserting DOM elements, Drupal JavaScript behaviors should be
+ * reattached and all top-level elements of type Node.ELEMENT_NODE need to be
+ * part of the context.
+ */
+ public function testInsertAjaxResponse() {
+ $render_single_root = [
+ 'pre-wrapped-div' => '