You are here

protected function ContextualLinkClickTrait::toggleContextualTriggerVisibility in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php \Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait::toggleContextualTriggerVisibility()
  2. 9 core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php \Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait::toggleContextualTriggerVisibility()

Toggles the visibility of a contextual trigger.

Parameters

string $selector: The selector for the element that contains the contextual link.

File

core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php, line 45

Class

ContextualLinkClickTrait
Functions for testing contextual links.

Namespace

Drupal\Tests\contextual\FunctionalJavascript

Code

protected function toggleContextualTriggerVisibility($selector) {

  // Hovering over the element itself with should be enough, but does not
  // work. Manually remove the visually-hidden class.
  $this
    ->getSession()
    ->executeScript("jQuery('{$selector} .contextual .trigger').toggleClass('visually-hidden');");
}