You are here

public function ColorboxJavascriptTest::testMobileDetection in Colorbox 8

Test the mobile detection.

File

tests/src/FunctionalJavascript/ColorboxJavascriptTest.php, line 99

Class

ColorboxJavascriptTest
Test the colorbox JavaScript.

Namespace

Drupal\Tests\colorbox\FunctionalJavascript

Code

public function testMobileDetection() {
  $this
    ->changeSetting('advanced.mobile_detect', TRUE);
  $this
    ->changeSetting('advanced.mobile_device_width', '1200px');
  $this
    ->getSession()
    ->resizeWindow(200, 200);
  $this
    ->drupalGet('node/' . $this->node
    ->id());
  $this
    ->assertSession()
    ->elementAttributeContains('css', '#colorbox', 'style', 'display: none;');
}