/**
* Helper to test toggling the summary area.
*
* @internal
*/
protected function assertSummaryToggle(): void
{ $this->
drupalGet('node/add/page'
);
$widget =
$this->
getSession()->
getPage()->
findById('edit-body-wrapper'
);
$summary_field =
$widget->
findField('edit-body-0-summary'
);
$this->
assertEquals(FALSE,
$summary_field->
isVisible(), 'Summary field is hidden by default.'
);
$this->
assertEquals(FALSE,
$widget->
hasButton('Hide summary'
), 'No Hide summary link by default.'
);
$widget->
pressButton('Edit summary'
);
$this->
assertEquals(FALSE,
$widget->
hasButton('Edit summary'
), 'Edit summary link is removed after clicking.'
);
$this->
assertEquals(TRUE,
$summary_field->
isVisible(), 'Summary field is shown.'
);
$widget->
pressButton('Hide summary'
);
$this->
assertEquals(FALSE,
$widget->
hasButton('Hide summary'
), 'Hide summary link is removed after clicking.'
);
$this->
assertEquals(FALSE,
$summary_field->
isVisible(), 'Summary field is hidden again.'
);
$this->
assertEquals(TRUE,
$widget->
hasButton('Edit summary'
), 'Edit summary link is visible again.'
);
}