From cdaa87e3188d15e0a8c0a78b878e9478771a183c Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 16 May 2022 11:49:23 +0100 Subject: [PATCH] Issue #3280614 by Spokje: (Not so) Random test failures QuickEditFileTest --- .../tests/src/FunctionalJavascript/QuickEditFileTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php b/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php index 53fad46e43b..dac348073ec 100644 --- a/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php +++ b/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\quickedit\FunctionalJavascript; +use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\file\Entity\File; use Drupal\node\Entity\Node; use Drupal\Tests\file\Functional\FileFieldCreationTrait; @@ -40,6 +41,13 @@ protected function setUp(): void { // Add file field to Article node type. $this->createFileField('field_file', 'node', 'article', ['file_extensions' => 'txt']); + // Move file field to the top of all fields, so its QuickEdit Toolbar won't + // overlap any QuickEdit-able fields, which causes (semi-)random test + // failures. + $entity_display = EntityViewDisplay::load('node.article.default'); + $entity_display->setComponent('field_file', ['weight' => 0]); + $entity_display->save(); + // Log in as a content author who can use Quick Edit and edit Articles. $user = $this->drupalCreateUser([ 'access contextual links',