You are here

public function ModerationDashboardComponentsTest::testModerationActivityChartWithoutData in Moderation Dashboard 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/ModerationDashboardComponentsTest.php \Drupal\Tests\moderation_dashboard\Functional\ModerationDashboardComponentsTest::testModerationActivityChartWithoutData()

Tests the empty moderation activity chart.

File

tests/src/Functional/ModerationDashboardComponentsTest.php, line 99

Class

ModerationDashboardComponentsTest
Tests moderation dashboard components.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

public function testModerationActivityChartWithoutData() {
  $this
    ->drupalGet('/user/' . $this->user
    ->id() . '/moderation/dashboard');
  $drupal_js_settings = $this
    ->getDrupalSettings();
  $this
    ->assertTrue(!isset($drupal_js_settings['moderation_dashboard_activity']));
  $moderation_activity_element = $this
    ->assertSession()
    ->elementExists('css', '.block-moderation-dashboard-activity');
  $this
    ->assertNotSame(FALSE, strpos($moderation_activity_element
    ->getText(), 'There has been no editor activity within the last month.'));
}