Issue #3321255: Only reload updated part of Layout Builder element
Merge request reports
Activity
157 $this->waitForOffCanvasArea(); 158 $off_canvas = $this->assertSession()->elementExists('css', '#drupal-off-canvas'); 159 $this->assertNotNull($off_canvas); 160 $form_id_element = $off_canvas->find('hidden_field_selector', ['hidden_field', 'form_id']); 161 // Ensure the form ID has the correct value and that the form is visible. 162 $this->assertNotEmpty($form_id_element); 163 $this->assertSame($expected_form_id, $form_id_element->getValue()); 164 $this->assertTrue($form_id_element->getParent()->isVisible()); 165 } 166 167 /** 168 * {@inheritdoc} 169 * 170 * @todo Remove this in https://www.drupal.org/project/drupal/issues/2918718. 171 */ 172 protected function clickContextualLink($selector, $link_locator, $force_visible = TRUE) { This is copied. I'm not sure if I was aware of the trait that already exists. It looks like there might be issues with the trait being fully functional in this context? The linked issue about it appears to still be open. I'm up for whatever, just want to make sure I'm thinking about it correctly.
@larowlan In looking at this a little bit closer,
Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest
(the test I referenced when creating the new test in this MR) usesDrupal\Tests\layout_builder\FunctionalJavascript\ContextualLinkClickTrait
and overrides theclickContextualLink
method from that trait. I think the reasoning behind this is that trait'sclickContextualLink
method doesn't currently work correctly with LB. The overridden method in the test class can be removed whenever that issue is resolved and then it will just be using the method from the trait.If I create a new trait with this method that is LB-specific and replace the instances where the other trait are used, then it is slightly more complicated to switch to the existing trait later on. Instead of just deleting the two overridden methods, it would require updating the use statements in both test classes and deleting the trait. The existing trait also has another method that is not overridden, so if I created a new trait, would I be copying that over as well?
If you would still like me to do this, I can do it. I just wanted to provide that context in case it influences the decision and get feedback about how to proceed.
Edited by Sean Adams-Hiett
added 575 commits
-
d26715fb...f00184db - 566 commits from branch
project:11.x
- dd917d51 - Adding code from MR 2951.
- a80bef4d - Added test for reloading blocks. Added supporting test module.
- 22f44f6b - Fixed code check issues.
- 841fa316 - Added missing class docblock.
- 75c16142 - Refactored to remove redundant code.
- faa879e2 - Added a missing comment.
- f401a522 - Fixed code check issues.
- 3f39ce68 - More code check issues fixed.
- f63dff57 - A little bit more cleanup.
Toggle commit list-
d26715fb...f00184db - 566 commits from branch