You are here

public function ModerationControlTest::testHiddenOnModerationSidebarInstall in Lightning Workflow 8.3

Tests that moderation controls are hidden if Moderation Sidebar is enabled.

File

tests/src/Kernel/ModerationControlTest.php, line 58

Class

ModerationControlTest
Tests default visibility of the content_moderation_control extra field.

Namespace

Drupal\Tests\lightning_workflow\Kernel

Code

public function testHiddenOnModerationSidebarInstall() {
  $values = [
    'targetEntityType' => 'node',
    'bundle' => 'page',
    'mode' => 'default',
    'status' => TRUE,
  ];
  $this
    ->assertArrayHasKey('content_moderation_control', EntityViewDisplay::create($values)
    ->getComponents());
  $this->container
    ->get('module_installer')
    ->install([
    'moderation_sidebar',
  ]);
  $hidden = EntityViewDisplay::create($values)
    ->get('hidden');
  $this
    ->assertTrue($hidden['content_moderation_control']);
}