You are here

public function TransitionTest::testSkipInvalidTransition in Lightning Scheduler 8

@depends testPublishInPast

File

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

Class

TransitionTest
@group lightning_scheduler

Namespace

Drupal\Tests\lightning_scheduler\FunctionalJavascript

Code

public function testSkipInvalidTransition() {
  $assert_session = $this
    ->assertSession();
  $this
    ->createTransition('Published', time() - 20);
  $this
    ->createTransition('Archived', time() - 10);
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save');
  $this
    ->cronRun();
  $this
    ->clickEditLink();

  // It will still be in the draft state because the transition should resolve
  // to Draft -> Archived, which doesn't exist.
  $assert_session
    ->pageTextContains('Current state Draft');
  $assert_session
    ->elementNotExists('css', '.scheduled-transition');
}