You are here

public function GeolocationCommonMapAjaxJavascriptTest::testCommonMapAjax in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 tests/src/FunctionalJavascript/GeolocationCommonMapAjaxJavascriptTest.php \Drupal\Tests\geolocation\FunctionalJavascript\GeolocationCommonMapAjaxJavascriptTest::testCommonMapAjax()
  2. 8.2 tests/src/FunctionalJavascript/GeolocationCommonMapAjaxJavascriptTest.php \Drupal\Tests\geolocation\FunctionalJavascript\GeolocationCommonMapAjaxJavascriptTest::testCommonMapAjax()

Tests the CommonMap style.

File

tests/src/FunctionalJavascript/GeolocationCommonMapAjaxJavascriptTest.php, line 124

Class

GeolocationCommonMapAjaxJavascriptTest
Tests the common map style AJAX JavaScript functionality.

Namespace

Drupal\Tests\geolocation\FunctionalJavascript

Code

public function testCommonMapAjax() {
  $this
    ->drupalGetFilterGoogleKey('geolocation-common-map-ajax-test');
  $session = $this
    ->getSession();
  $this
    ->assertSession()
    ->responseContains('Location 1');
  $this
    ->assertSession()
    ->responseContains('Location 3');
  $this
    ->submitForm([
    'field_geolocation_boundary[lat_north_east]' => '53',
    'field_geolocation_boundary[lng_north_east]' => '48',
    'field_geolocation_boundary[lat_south_west]' => '51',
    'field_geolocation_boundary[lng_south_west]' => '46',
  ], 'Apply', 'views-exposed-form-geolocation-common-map-ajax-test-page-1');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $html = $session
    ->getPage()
    ->getHtml();
  $this
    ->assertContains('Location 1', $html);
  $this
    ->assertNotContains('Location 3', $html);
}