Create unit test coverage for `ValidSlotNameConstraintValidator`

Created on 4 June 2025, 4 months ago

Overview

๐Ÿ“Œ Constraint slot names allowed by XB in its component tree Active added ValidSlotNameConstraintValidator.

It added comprehensive test coverage in ComponentValidationTest::testSlotNameValidation(), where you'll see:

   * @testWith ["valid", false]
   *   ["even_more-valid", false]
   *   ["-", true]
   *   ["--", true]
   *   ["_", true]
   *   ["__", true]
   *   ["-not_valid", true]
   *   ["_not_valid", true]
   *   ["not_valid-", true]
   *   ["not_valid_", true]
   *   ["a", true]
   *   ["aa", true]
   *   ["aaa", false]
   *   ["n๐Ÿ˜ˆt_valid", true]
   *   ["spaces aren't okay", true]
   *   ["newline\nnot_allowed", true]
   *   ["rm -rf /", true]
   *   ["slot_\u03E2eird", true]

The problem: that takes ~2 minutes! Because it's a kernel test.

Proposed resolution

  1. Add unit test for ValidSlotNameConstraintValidator
  2. Remove all test cases except for one valid and one invalid from ComponentValidationTest::testSlotNameValidation()

User interface changes

None.

๐Ÿ“Œ Task
Status

Active

Version

0.0

Component

Config management

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024