You are here

public function TransitionTest::testClearCompletedTransitions in Lightning Scheduler 8

File

tests/src/FunctionalJavascript/TransitionTest.php, line 88

Class

TransitionTest
@group lightning_scheduler

Namespace

Drupal\Tests\lightning_scheduler\FunctionalJavascript

Code

public function testClearCompletedTransitions() {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $now = time();
  $page
    ->selectFieldOption('moderation_state[0][state]', 'In review');
  $page
    ->pressButton('Save');
  $this
    ->clickEditLink();
  $this
    ->createTransition('Published', $now + 8);
  $page
    ->pressButton('Save');
  $this
    ->setRequestTime($now + 10);
  $this
    ->cronRun();
  $this
    ->clickEditLink();
  $page
    ->selectFieldOption('moderation_state[0][state]', 'Archived');
  $page
    ->pressButton('Save');
  $this
    ->cronRun();
  $this
    ->clickEditLink();
  $assert_session
    ->pageTextContains('Current state Archived');
}