diff --git a/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.es6.js b/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.es6.js
new file mode 100644
index 0000000000..5114611505
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.es6.js
@@ -0,0 +1,31 @@
+/**
+ * @file
+ *  Testing behavior for JSWebAssertTest.
+ */
+
+(function ($, Drupal) {
+
+  /**
+   * Test ajax command.
+   *
+   * @param {Drupal.Ajax} [ajax]
+   *   {@link Drupal.Ajax} object created by {@link Drupal.ajax}.
+   * @param {object} response
+   *   The response from the Ajax request.
+   * @param {string} response.selector
+   *   A jQuery selector string.
+   */
+  Drupal.AjaxCommands.prototype.jsAjaxTestCommand = function (ajax, response) {
+    const $domElement = $(response.selector);
+    ajax.element_settings.cat = 'catbro';
+    debugger;
+
+    const data = {
+      element_settings: ajax.element_settings.cat || {},
+      elementSettings: ajax.elementSettings.cat || {},
+    };
+
+    $domElement.html(`<div id="js_ajax_test_form_element">${JSON.stringify(data)}</div>`);
+  };
+
+}(jQuery, Drupal));
diff --git a/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.js b/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.js
new file mode 100644
index 0000000000..c17bfde38c
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.js
@@ -0,0 +1,21 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+(function ($, Drupal) {
+  Drupal.AjaxCommands.prototype.jsAjaxTestCommand = function (ajax, response) {
+    var $domElement = $(response.selector);
+    ajax.element_settings.cat = 'catbro';
+    debugger;
+
+    var data = {
+      element_settings: ajax.element_settings.cat || {},
+      elementSettings: ajax.elementSettings.cat || {}
+    };
+
+    $domElement.html('<div id="js_ajax_test_form_element">' + JSON.stringify(data) + '</div>');
+  };
+})(jQuery, Drupal);
\ No newline at end of file
diff --git a/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.info.yml b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.info.yml
new file mode 100644
index 0000000000..b11dd68cf5
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.info.yml
@@ -0,0 +1,6 @@
+name: 'JS ajax test'
+type: module
+description: ''
+package: Testing
+version: VERSION
+core: 8.x
diff --git a/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.libraries.yml b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.libraries.yml
new file mode 100644
index 0000000000..8f28e67844
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.libraries.yml
@@ -0,0 +1,8 @@
+ajax:
+  version: VERSION
+  js:
+    js/js_ajax_test.ajax.js: {}
+  dependencies:
+    - core/jquery
+    - core/drupal
+    - core/drupal.ajax
diff --git a/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.routing.yml b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.routing.yml
new file mode 100644
index 0000000000..5d643b93d1
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/js_ajax_test.routing.yml
@@ -0,0 +1,6 @@
+js_ajax_test.js_ajax_test:
+  path: '/js_ajax_test'
+  defaults:
+    _form: '\Drupal\js_ajax_test\Form\JsAjaxTestForm'
+  requirements:
+    _access: 'TRUE'
diff --git a/core/modules/system/tests/modules/js_ajax_test/src/Ajax/JsAjaxTestCommand.php b/core/modules/system/tests/modules/js_ajax_test/src/Ajax/JsAjaxTestCommand.php
new file mode 100644
index 0000000000..a76d42c425
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/src/Ajax/JsAjaxTestCommand.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Drupal\js_ajax_test\Ajax;
+
+use Drupal\Core\Ajax\CommandInterface;
+
+/**
+ * Test ajax command.
+ */
+class JsAjaxTestCommand implements CommandInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function render() {
+    return [
+      'command' => 'jsAjaxTestCommand',
+      'selector' => '#js_ajax_test_form_wrapper',
+    ];
+  }
+
+}
diff --git a/core/modules/system/tests/modules/js_ajax_test/src/Form/JsAjaxTestForm.php b/core/modules/system/tests/modules/js_ajax_test/src/Form/JsAjaxTestForm.php
new file mode 100644
index 0000000000..f5895ea096
--- /dev/null
+++ b/core/modules/system/tests/modules/js_ajax_test/src/Form/JsAjaxTestForm.php
@@ -0,0 +1,64 @@
+<?php
+
+namespace Drupal\js_ajax_test\Form;
+
+use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\js_ajax_test\Ajax\JsAjaxTestCommand;
+
+/**
+ * Test form for js_ajax_test
+ *
+ * @internal
+ */
+class JsAjaxTestForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'js_ajax_test_form';
+  }
+
+  /**
+   * Form for testing the addition of various types of elements via AJAX.
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form['#attached']['library'][] = 'js_ajax_test/ajax';
+    $form['custom']['#prefix'] = '<div id="js_ajax_test_form_wrapper">';
+    $form['custom']['#suffix'] = '</div>';
+
+    // Button to test for the waitForButton() assertion.
+    $form['test_button'] = [
+      '#type' => 'submit',
+      '#value' => $this->t('Add button'),
+      '#button_type' => 'primary',
+      '#ajax' => [
+        'callback' => [static::class, 'addButton'],
+        'progress' => [
+          'type' => 'throbber',
+          'message' => NULL,
+        ],
+        'wrapper' => 'js_ajax_test_form_wrapper',
+      ],
+    ];
+    return $form;
+  }
+
+  /**
+   * Ajax callback for the "Add button" button.
+   */
+  public static function addButton(array $form, FormStateInterface $form_state) {
+    return (new AjaxResponse())
+      ->addCommand(new JsAjaxTestCommand());
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+
+  }
+
+}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/BackwardCompabilityTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/BackwardCompabilityTest.php
new file mode 100644
index 0000000000..81d15431d5
--- /dev/null
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/BackwardCompabilityTest.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\FunctionalJavascriptTests\Ajax;
+
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+
+class BackwardCompabilityTest extends JavascriptTestBase {
+
+  public static $modules = [
+    'js_ajax_test',
+  ];
+
+  public function testAjaxBackwardCompability() {
+    $this->drupalGet('/js_ajax_test');
+    $this->click('#edit-test-button');
+
+    $this->assertSession()
+      ->waitForElement('css', '#js_ajax_test_form_element');
+    $elements = $this->cssSelect('#js_ajax_test_form_element');
+    $this->assertCount(1, $elements);
+    $json = $elements[0]->getText();
+    $data = json_decode($json, TRUE);
+    $this->assertEquals([
+      'element_settings' => 'catbro',
+      'elementSettings' => 'catbro',
+    ], $data);
+  }
+
+}
