diff --git a/src/Element/ZoneTerritory.php b/src/Element/ZoneTerritory.php
index 663d2a7..84ddceb 100644
--- a/src/Element/ZoneTerritory.php
+++ b/src/Element/ZoneTerritory.php
@@ -298,7 +298,7 @@ class ZoneTerritory extends FormElement {
    */
   public static function ajaxRefresh(array $form, FormStateInterface $form_state) {
     $triggering_element = $form_state->getTriggeringElement();
-    return NestedArray::getValue($form, array_slice($triggering_element['#array_parents'], 0, -1));
+    return NestedArray::getValue($form, array_slice($triggering_element['#array_parents'], 0, -2));
   }
 
   /**
diff --git a/tests/modules/address_test/address_test.routing.yml b/tests/modules/address_test/address_test.routing.yml
index 68a40b8..2e398d2 100644
--- a/tests/modules/address_test/address_test.routing.yml
+++ b/tests/modules/address_test/address_test.routing.yml
@@ -5,3 +5,11 @@ address_test.default_value_test_form:
     _title: 'Default value test form'
   requirements:
     _access: 'TRUE'
+
+address_test.zone_territory_test_form:
+  path: '/address_test/zone_territory_test_form'
+  defaults:
+    _form: '\Drupal\address_test\Form\ZoneTerritoryTestForm'
+    _title: 'Zone territory test form'
+  requirements:
+    _access: 'TRUE'
diff --git a/tests/modules/address_test/src/Form/ZoneTerritoryTestForm.php b/tests/modules/address_test/src/Form/ZoneTerritoryTestForm.php
new file mode 100644
index 0000000..61c1746
--- /dev/null
+++ b/tests/modules/address_test/src/Form/ZoneTerritoryTestForm.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Drupal\address_test\Form;
+
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Used to test the address zone territory form element.
+ */
+class ZoneTerritoryTestForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'address_zone_territory_test_form';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form['territory'] = [
+      '#type' => 'address_zone_territory',
+      '#default_value' => 'AG',
+      '#required' => TRUE,
+    ];
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+  }
+
+}
diff --git a/tests/src/FunctionalJavascript/ZoneTerritoryElementTest.php b/tests/src/FunctionalJavascript/ZoneTerritoryElementTest.php
new file mode 100644
index 0000000..275c1a4
--- /dev/null
+++ b/tests/src/FunctionalJavascript/ZoneTerritoryElementTest.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\Tests\address\FunctionalJavascript;
+
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
+
+/**
+ * Tests the Zone Territory form element.
+ *
+ * @group address
+ */
+class ZoneTerritoryElementTest extends WebDriverTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = [
+    'system',
+    'user',
+    'field',
+    'node',
+    'address',
+    'address_test'
+  ];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
+  /**
+   * Tests the zone territory form element.
+   */
+  public function testZoneTerritory() {
+    $this->drupalGet('/address_test/zone_territory_test_form');
+    $this->getSession()->getPage()->selectFieldOption('territory[country_code]', 'US');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->assertFieldByName('territory[administrative_area]');
+    $this->assertFieldByName('territory[limit_by_postal_code]');
+  }
+
+}
