You are here

public function AdminToolbarStateTaxonomyTermTest::testNotModeratedEntity in Moderation Sidebar 8

Tests state labels in admin toolbar with a not moderated entity.

File

tests/src/Functional/AdminToolbarStateTaxonomyTermTest.php, line 63

Class

AdminToolbarStateTaxonomyTermTest
Contains test for the toolbar state label for taxonomy_term.

Namespace

Drupal\Tests\moderation_sidebar\Functional

Code

public function testNotModeratedEntity() {
  $term = $this
    ->createTerm($this->vocabulary);
  $url = $term
    ->toUrl()
    ->toString();
  $assert_session = $this
    ->assertSession();

  // Draft.
  $term
    ->set('status', 0);
  $term
    ->save();
  $this
    ->drupalGet($url);
  $assert_session
    ->elementExists('css', '.moderation-label-draft[data-label="Draft"]');

  // Published.
  $term
    ->set('status', 1);
  $term
    ->save();
  $this
    ->drupalGet($url);
  $assert_session
    ->elementExists('css', '.moderation-label-published[data-label="Published"]');
}