From 89be8e6359a3f5ed7d1b79c6870f036576963639 Mon Sep 17 00:00:00 2001 From: Paul Weidner Date: Fri, 11 Aug 2023 12:08:56 -0700 Subject: [PATCH] Add test assertion for quick form help text --- .../quick/tests/src/Functional/QuickFormTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/core/quick/tests/src/Functional/QuickFormTest.php b/modules/core/quick/tests/src/Functional/QuickFormTest.php index 18c55ef99..12b1182c3 100644 --- a/modules/core/quick/tests/src/Functional/QuickFormTest.php +++ b/modules/core/quick/tests/src/Functional/QuickFormTest.php @@ -20,8 +20,19 @@ class QuickFormTest extends FarmBrowserTestBase { */ protected static $modules = [ 'farm_quick_test', + 'help', ]; + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + + // Add the help block, so we can test help text. + $this->drupalPlaceBlock('help_block'); + } + /** * Test quick forms. */ @@ -67,9 +78,11 @@ class QuickFormTest extends FarmBrowserTestBase { $this->assertSession()->pageTextContains($this->t('Test configurable quick form 2')); $this->assertSession()->pageTextNotContains($this->t('Test requiresEntity quick form')); - // Go to the test quick form and confirm that the test field is visible. + // Go to the test quick form and confirm that the help text and test field + // is visible. $this->drupalGet('quick/test'); $this->assertSession()->statusCodeEquals(200); + $this->assertSession()->pageTextContains($this->t('Test quick form help text.')); $this->assertSession()->pageTextContains($this->t('Test field')); // Go to the default configurable_test quick form and confirm access is