Commit a1c4ca7b authored by catch's avatar catch
Browse files

Issue #3280614 by Spokje: (Not so) Random test failures QuickEditFileTest

parent 64aebe15
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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',