You are here

public function LayoutBuilderMediaTest::testMediaLayout in Core Context 8

Tests that the layout of a media type can be edited.

File

tests/src/Functional/LayoutBuilderMediaTest.php, line 34

Class

LayoutBuilderMediaTest
Tests integration with the core Media and Layout Builder modules.

Namespace

Drupal\Tests\core_context\Functional

Code

public function testMediaLayout() : void {
  $media_type = $this
    ->createMediaType('image')
    ->id();
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet("/admin/structure/media/manage/{$media_type}/display");
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->checkField('Use Layout Builder');
  $page
    ->pressButton('Save');
  $page
    ->clickLink('Manage layout');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}