CanvasTestSetup and ContentTemplateOnDependencyRemovalTest should not rely on magic and specify component versions for its test component tree
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3583494. --> Reported by: [wim leers](https://www.drupal.org/user/99777) Related to !877 >>> <h3 id="overview">Overview</h3> <p><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3582478" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3582478</a></span> is refining the config schema for config entities that carry component trees. In doing so, <code>component_version</code> is now explicitly expected to be present for each component instance. And it's starting to trigger a validation error.</p> <p><code>CanvasTestSetup</code>'s component tree is primarily used for Auto-save tests (and Cypress E2E tests) and is relying on auto-magic setting of component version.</p> <p>Note: <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3531679" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3531679</a></span> aims to decouple some of Canvas' kernel tests from <code>CanvasTestSetup</code>. This would get us one step closer.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>Explicitly remove the magic by using <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3572847" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3572847</a></span>'s <code>DataProviderWithComponentTreeTrait</code>.</p> <h3 id="ui-changes">User interface changes</h3> <p>None.</p>
issue