Create unit test coverage for `ValidSlotNameConstraintValidator`
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3528360. -->
Reported by: [wim leers](https://www.drupal.org/user/99777)
Related to !98 !1506 !1200
>>>
<h3 id="overview">Overview</h3>
<p><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3519891" title="Status: Closed (fixed)">#3519891: Constrain slot names allowed by XB in Components (and in its component tree)</a></span> added <code>ValidSlotNameConstraintValidator</code>.</p>
<p>It added comprehensive test coverage in <code>ComponentValidationTest::testSlotNameValidation()</code>, where you'll see:</p>
<pre> * @testWith ["valid", false]<br> * ["even_more-valid", false]<br> * ["-", true]<br> * ["--", true]<br> * ["_", true]<br> * ["__", true]<br> * ["-not_valid", true]<br> * ["_not_valid", true]<br> * ["not_valid-", true]<br> * ["not_valid_", true]<br> * ["a", true]<br> * ["aa", true]<br> * ["aaa", false]<br> * ["n😈t_valid", true]<br> * ["spaces aren't okay", true]<br> * ["newline\nnot_allowed", true]<br> * ["rm -rf /", true]<br> * ["slot_\u03E2eird", true]</pre><p>The problem: that takes ~2 minutes! Because it's a kernel test.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<ol>
<li>Add unit test for <code>ValidSlotNameConstraintValidator</code></li>
<li>Remove all test cases except for one valid and one invalid from <code>ComponentValidationTest::testSlotNameValidation()</code></li>
<li>
</ol>
<h3 id="ui-changes">User interface changes</h3>
<p>None.</p>
> Related issue: [Issue #3519891](https://www.drupal.org/node/3519891)
issue