Problem/Motivation

Splitting the #3595219: 3.0 Exploration proof-of-concept into nine standalone issues landed every feature on 3.x, but three pieces of test coverage from the PoC were not carried over. The features work; they are simply unverified, so a future regression in any of them would pass CI silently.

The gaps:

  • Term select without a depth argument. WebformElementWebformTermSelect.options takes an optional depth argument (kept additive in #3598973: Options/selection elements). tests/src/Kernel/Element/TermSelectTest.php only ever queries options(depth: ...), so the path where depth is omitted is untested.
  • Per-element time-token cacheability. A [date:*] token in an element property such as #description bubbles max-age=0, which the element resolver must surface on the response (foundation landed in #3598935: Improve cacheability and rendering). tests/src/Kernel/Element/DefaultValueTokenCacheabilityTest.php and tests/src/Kernel/Element/TokenPrefillCacheabilityTest.php cover default-value and prefill tokens, but not a time token in an arbitrary visible element property.
  • Empty-string submissions across element types. A frontend submits '' when a user clears a field, and the mutation must accept that as "no value" rather than erroring. The datelist fix landed in #3599000: Date/time submission and tests/src/Kernel/Mutation/FormSubmissionDatelistTest.php covers datelist, but there is no test asserting clean acceptance of '' across the broader set of element types.

Proposed resolution

Add the three missing test cases against the existing exported fixtures, in one change. No production code change is expected.

  • Term select: extend TermSelectTest (or add a query mirroring tests/queries/term_select.gql with depth dropped) to assert options resolves to the full term list when depth is omitted, and that the per-term plus taxonomy_term_list cache tags are emitted.
  • Time-token cacheability: add a kernel test that puts a [date:*] token in a textfield #description and asserts the GraphQL response carries max-age=0. Reuse or extend tests/modules/graphql_webform_test/config/install/webform.webform.graphql_webform_test_date_token.yml.
  • Empty string: add a mutation test extending tests/src/Kernel/Mutation/FormSubmissionTestBase.php that submits '' to a representative element of each family and asserts the submission saves with an empty value and no error.

Remaining tasks

  • Write the three tests.
  • Confirm no production change is needed; if any test surfaces a real defect, split that fix into its own issue under #3595219: 3.0 Exploration.
  • Run phpunit, phpcs and phpstan.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pfrenssen created an issue. See original summary.

  • pfrenssen committed bd9e5df0 on 3.x
    task: #3602639 Test coverage gaps from the #3595219 split: term-select...
pfrenssen’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.