Create unit test coverage for `ValidSlotNameConstraintValidator`

Created on 4 June 2025, 2 days 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

Comments & Activities

Production build 0.71.5 2024