Add test coverage of the listing pages for each content type

Created on 14 January 2025, 3 months ago

We have some test coverage of the listing pages but we are missing any for the Person listing page, and we don't know if the page fields are showing up in the correct order. Let's add test coverage of this.

πŸ“Œ Task
Status

Active

Component

General

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • First commit to issue fork.
  • Pipeline finished with Success
    2 months ago
    Total: 962s
    #426571
  • The pipeline failed in previous approach due to a test failure caused because the interface LayoutEntityDisplayInterface extends SectionListInterface. This causes the following condition:

    if (($display instanceof LayoutEntityDisplayInterface && $display->isLayoutBuilderEnabled()) || $display instanceof SectionListInterface) {
    

    to be true for both Layout Builder enabled displays and displays without it, leading to test failures.

    To fix this, I updated the code to get the default view display for the node's content type directly, instead of relying on the Layout Builder field list display object (Drupal\layout_builder\Field\LayoutSectionItemList).

    $display_repository = $this->container->get(EntityDisplayRepositoryInterface::class);
    $listing_page_display = $display_repository->getViewDisplay('node', $listing_page->bundle());
    
  • Pipeline finished with Success
    2 months ago
    Total: 1340s
    #426598
  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Adding credit based on the MR.

  • πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

    Tests failing, Moving back to Needs Work.

  • The issue arises because LayoutEntityDisplayInterface extends SectionListInterface, meaning that any display implementing LayoutEntityDisplayInterface is also an instance of SectionListInterface. This causes the condition

     ($display instanceof LayoutEntityDisplayInterface && $display->isLayoutBuilderEnabled()) || $display instanceof SectionListInterface )
    

    to incorrectly include displays that are not layout-enabled (e.g., card/teaser displays) because they satisfy the instance of SectionListInterface check.

Production build 0.71.5 2024