Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / config / tests / src / FunctionalJavascript / ConfigEntityTest.php
diff --git a/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php b/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
new file mode 100644 (file)
index 0000000..110c9f8
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests\config\FunctionalJavascript;
+
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+
+/**
+ * Tests the Config operations through the UI.
+ *
+ * @group config
+ */
+class ConfigEntityTest extends JavascriptTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['config_test'];
+
+  /**
+   * Tests ajax operations through the UI on 'Add' page.
+   */
+  public function testAjaxOnAddPage() {
+    $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+
+    $page = $this->getSession()->getPage();
+    $assert_session = $this->assertSession();
+
+    $this->drupalGet('admin/structure/config_test/add');
+    // Test that 'size value' field is not show initially, and it is show after
+    // selecting value in the 'size' field.
+    $this->assertNull($page->findField('size_value'));
+    $page->findField('size')->setValue('custom');
+    $this->assertNotNull($assert_session->waitForField('size_value'));
+  }
+
+}