You are here

protected function DisplayTest::toggleContextualTriggerVisibility in Drupal 8

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

Toggles the visibility of a contextual trigger.

Parameters

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

1 call to DisplayTest::toggleContextualTriggerVisibility()
DisplayTest::testPageContextualLinks in core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
Tests contextual links on Views page displays.

File

core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php, line 124

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\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');");
}