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>&nbsp;&nbsp; * @testWith ["valid", false]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["even_more-valid", false]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["-", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["--", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["_", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["__", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["-not_valid", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["_not_valid", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["not_valid-", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["not_valid_", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["a", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["aa", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["aaa", false]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["n&#128520;t_valid", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["spaces aren't okay", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["newline\nnot_allowed", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["rm -rf /", true]<br>&nbsp;&nbsp; *&nbsp;&nbsp; ["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