Fix DateRecurFieldSettingsTest to use status message assertions instead of exact save text
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3545039. -->
Reported by: [joelpittet](https://www.drupal.org/user/160302)
Related to !62
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Functional tests in <code>DateRecurFieldSettingsTest</code> fail because they assert an exact flash message (<code>"Saved foo configuration."</code>) that changed in Drupal core. The message wording/case now differs, so Mink cannot find the text.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ol>
<li>Run the functional test suite for <code>date_recur</code>.</li>
<li>Observe 4 failures in <code>DateRecurFieldSettingsTest</code> where the save confirmation text is asserted.</li>
</ol>
<pre>There were 4 failures:<br><br>1) Drupal\Tests\date_recur\Functional\DateRecurFieldSettingsTest::testAllAllowed<br>Behat\Mink\Exception\ResponseTextException: The text "Saved foo configuration." was not found anywhere in the text of the current page.<br><br>/var/www/html/vendor/behat/mink/src/WebAssert.php:907<br>/var/www/html/vendor/behat/mink/src/WebAssert.php:293<br>/var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:981<br>/var/www/html/tests/src/Functional/DateRecurFieldSettingsTest.php:79<br><br>2) Drupal\Tests\date_recur\Functional\DateRecurFieldSettingsTest::testAllDisabled<br>Behat\Mink\Exception\ResponseTextException: The text "Saved foo configuration." was not found anywhere in the text of the current page.<br><br>/var/www/html/vendor/behat/mink/src/WebAssert.php:907<br>/var/www/html/vendor/behat/mink/src/WebAssert.php:293<br>/var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:981<br>/var/www/html/tests/src/Functional/DateRecurFieldSettingsTest.php:109<br><br>3) Drupal\Tests\date_recur\Functional\DateRecurFieldSettingsTest::testAllPartsInFrequency<br>Behat\Mink\Exception\ResponseTextException: The text "Saved foo configuration." was not found anywhere in the text of the current page.<br><br>/var/www/html/vendor/behat/mink/src/WebAssert.php:907<br>/var/www/html/vendor/behat/mink/src/WebAssert.php:293<br>/var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:981<br>/var/www/html/tests/src/Functional/DateRecurFieldSettingsTest.php:142<br><br>4) Drupal\Tests\date_recur\Functional\DateRecurFieldSettingsTest::testSomePartsInFrequency<br>Behat\Mink\Exception\ResponseTextException: The text "Saved foo configuration." was not found anywhere in the text of the current page.<br><br>/var/www/html/vendor/behat/mink/src/WebAssert.php:907<br>/var/www/html/vendor/behat/mink/src/WebAssert.php:293<br>/var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:981<br>/var/www/html/tests/src/Functional/DateRecurFieldSettingsTest.php:182<br><br>FAILURES!</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Replace brittle page text assertions with status message assertions that don’t depend on exact wording:<br>
<pre>$this->assertSession()->statusMessageContains('Saved', 'status');</pre></li>
</ul>
> Related issue: [Issue #3537202](https://www.drupal.org/node/3537202)
issue