Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / tests / src / FunctionalJavascript / TestSettingSummariesContentType.php
diff --git a/web/core/modules/node/tests/src/FunctionalJavascript/TestSettingSummariesContentType.php b/web/core/modules/node/tests/src/FunctionalJavascript/TestSettingSummariesContentType.php
new file mode 100644 (file)
index 0000000..4760ee6
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\Tests\node\FunctionalJavascript;
+
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+
+/**
+ * Tests the JavaScript updating of summaries on content type form.
+ *
+ * @group node
+ */
+class TestSettingSummariesContentType extends JavascriptTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['node'];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+
+    $admin_user = $this->drupalCreateUser(['administer content types']);
+    $this->drupalLogin($admin_user);
+    $this->drupalCreateContentType(['type' => 'test']);
+  }
+
+  /**
+   * Test a vertical tab 'Workflow' summary.
+   */
+  public function testWorkflowSummary() {
+    $this->drupalGet('admin/structure/types/manage/test');
+    $page = $this->getSession()->getPage();
+    $page->findField('options[status]')->uncheck();
+    $page->findField('options[sticky]')->check();
+    $page->findField('options[promote]')->check();
+    $page->findField('options[revision]')->check();
+    $locator = '[href="#edit-workflow"] .vertical-tabs__menu-item-summary';
+    $page->waitFor(10, function () use ($page, $locator) {
+      $summary = $page->find('css', $locator)->getText();
+      return strpos('Not published', $summary) !== FALSE;
+    });
+    $summary = $page->find('css', $locator)->getText();
+    $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);
+  }
+
+}