Problem/Motivation

Improve tests for layouts

Remaining tasks

  • Test deriver plugin
  • Test rendering : verify entity context is correctly passed to source plugins (slots and props), especially in the case of layout builder and field layout display (and field layout form?)
  • Tests of possible integration ? inside layout builder, inside field layout display (and field layout form?)
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

just_like_good_vibes created an issue. See original summary.

pdureau’s picture

Title: [2.0.0-beta2] Layouts: Tests » [2.0.0-beta3] Layouts: Tests
pdureau’s picture

Title: [2.0.0-beta3] Layouts: Tests » [2.0.0-beta4] Layouts: Tests

christian.wiedemann made their first commit to this issue’s fork.

christian.wiedemann’s picture

Hi checked the tests right now. I think Mikael had everything implemented expect the field ui stuff? Am I right?

christian.wiedemann’s picture

Assigned: Unassigned » just_like_good_vibes

What do you think is missing? Just let me know

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Issue summary: View changes
Status: Active » Needs work

hello, i think yes, everything has been already done, especially in #3467657: [2.0.0-beta3] Sources: Tests for example.

- Test deriver plugin : ok
- test rendering with field layout : modules/ui_patterns_layouts/tests/src/Functional/LayoutFieldFormatterRenderTest.php
- test rendering with layout builder : modules/ui_patterns_layouts/tests/src/Functional/LayoutBuilderFieldFormatterRenderTest.php
- tests form integration in layout builder : modules/ui_patterns_layouts/tests/src/Functional/LayoutBuilderRenderTest.php

just_like_good_vibes’s picture

Issue summary: View changes

hello, i think yes, everything has been already done, especially in #3467657: [2.0.0-beta3] Sources: Tests for example.

- Test deriver plugin : ok
- test rendering with field layout : modules/ui_patterns_layouts/tests/src/Functional/LayoutFieldFormatterRenderTest.php
- test rendering with layout builder : modules/ui_patterns_layouts/tests/src/Functional/LayoutBuilderFieldFormatterRenderTest.php
- tests form integration in layout builder : modules/ui_patterns_layouts/tests/src/Functional/LayoutBuilderRenderTest.php

maybe what is missing is "Tests of possible integration ? iinside field layout display (and field layout form?)"
We should decide if we write a new test case for this or not.

just_like_good_vibes’s picture

Title: [2.0.0-beta4] Layouts: Tests » [2.0.0-beta5] Remaining Layouts Tests
pdureau’s picture

Title: [2.0.0-beta5] Remaining Layouts Tests » [2.0.0-rc1] Remaining Layouts Tests
christian.wiedemann’s picture

Assigned: Unassigned » christian.wiedemann
christian.wiedemann’s picture

Title: [2.0.0-rc1] Remaining Layouts Tests » [2.0.0-rc1] Add render tests Field Layout

christian.wiedemann’s picture

I found two bugs with field layout. One I fixed with empty context for field_layouts. The rendering of forms inside a layout leads right now to empty slot because our Layout Component overwrites the build keys inside the region. This is also the reason why one test fails.

So should we support field_layout forms?

christian.wiedemann’s picture

Assigned: christian.wiedemann » just_like_good_vibes
Status: Needs work » Needs review
just_like_good_vibes’s picture

Assigned: just_like_good_vibes » christian.wiedemann
Status: Needs review » Needs work

Hello Christian,
you set in review but the MR is not green ?
do i still need to review it?

pdureau’s picture

1) Drupal\Tests\ui_patterns_layouts\Functional\FieldLayoutRenderTest::testRenderForm
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".field--name-body" not found.
/builds/project/ui_patterns/vendor/behat/mink/src/WebAssert.php:465
/builds/project/ui_patterns/modules/ui_patterns_layouts/tests/src/Functional/FieldLayoutRenderTest.php:115

2) Drupal\Tests\ui_patterns_layouts\Functional\LayoutBuilderRenderTest::testRenderProps
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".layout-builder-block" not found.
/builds/project/ui_patterns/vendor/behat/mink/src/WebAssert.php:465
/builds/project/ui_patterns/modules/ui_patterns_layouts/tests/src/Functional/LayoutBuilderRenderTest.php:78
pdureau’s picture

The remaining problem is from $build[$region_name] = $regions[$region_name]; we did for Layout Builder integration, but may not work well with Field Layout with Entity Form Displays.

We don't need to test with the Entity Form Displays because SDC is not compatible with the Form API yet, so do we remove the related tests and merge the relevant tests?

just_like_good_vibes’s picture

i take it back to check and finish for merge

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » christian.wiedemann
Status: Needs work » Needs review
just_like_good_vibes’s picture

i added a few minor changes.
and removed the unwanted tests. please review Christian :)

christian.wiedemann’s picture

Assigned: christian.wiedemann » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

christian.wiedemann’s picture