test: #3616302 Add regression test coverage for the config import fix

Follow-up to the fix merged in !11 (merged) on #3616302: adds the automated regression coverage that issue had none of.

Problem/Motivation

CanvasOverrideHooks ensured field_canvas_layout from a node_type_presave hook, which fires before the bundle entity exists. Importing a node type whose config carries the canvas_override enabled third-party setting inline therefore aborted:

In EntityType.php line 964:
  Missing bundle entity, entity type node_type, entity id landing_inline.

!11 (merged) fixed it (node_type_insert / node_type_update plus an \Drupal::isConfigSyncing() guard), but nothing in the suite would catch a regression. The existing marketing_campaign_test_base fixture deliberately routes around the bug — it enables Canvas Override through a post-import config action, so it stays green either way.

Proposed resolution

  • tests/fixtures/canvas_override_inline_import_test_base — a recipe shipping node.type.inline_campaign with the setting inline, the way a distribution author would naively author an already-on type. Applying it is itself the gate: on regressed code the apply fails and the job goes red before the browser starts.
  • tests/features/{drupal,drupalcms}/02-03-01-config-import-inline.feature — assert the imported type is Canvas Override-enabled and carries the Canvas Layout field. Reuses the existing steps and selectors; no new step definitions.
  • tests/src/Unit/CanvasOverrideHookRegistrationTest.php — reflects over the #[Hook] attributes so node_type_insert/_update stay registered, node_type_presave is never reintroduced, and the isConfigSyncing() guard is not silently dropped. No kernel needed.
  • .gitlab-ci.yml — apply the fixture in both varbase-e2e before_scripts.

Testing

Verified on Varbase 11 (Drupal 11.4.5) and on Drupal CMS:

  • On the pre-fix hook the fixture reproduces the reported failure exactly (Missing bundle entity, node type absent).
  • With the fix it imports cleanly — type loaded, Canvas Override enabled, field_canvas_layout created with the component_tree storage.
  • Both feature scenarios pass on both bases (2 scenarios, 8 steps).
  • Local pipeline green via gitlab-ci-local: cspell, eslint, varbase-e2e-dry-run, pages.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading