diff --git a/src/Tests/PathautoUiTest.php b/src/Tests/PathautoUiTest.php
index 28c0f9b..6e0bac5 100644
--- a/src/Tests/PathautoUiTest.php
+++ b/src/Tests/PathautoUiTest.php
@@ -24,7 +24,7 @@ class PathautoUiTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('pathauto', 'node');
+  public static $modules = array('pathauto', 'node', 'menu_ui');
 
   /**
    * Admin user.
@@ -48,6 +48,7 @@ class PathautoUiTest extends WebTestBase {
       'administer url aliases',
       'create url aliases',
       'administer nodes',
+      'administer menu',
       'bypass node access',
       'access content overview',
     );
@@ -183,4 +184,67 @@ class PathautoUiTest extends WebTestBase {
     $this->assertFalse(PathautoPattern::load('page_pattern'));
   }
 
+  /**
+   * Tests the joining of node parents.
+   *
+   * Regression test for https://www.drupal.org/node/2769299
+   */
+  public function testJoinParents() {
+    // Try to save an empty pattern, should not be allowed.
+    $this->drupalGet('admin/config/search/path/patterns/add');
+    $edit = array(
+      'type' => 'canonical_entities:node',
+    );
+    $this->drupalPostAjaxForm(NULL, $edit, 'type');
+    $edit += array(
+      'bundles[page]' => TRUE,
+      'label' => 'Page pattern',
+      'id' => 'page_pattern',
+      'pattern' => '[node:menu-link:parents:join-path]/[node:title]',
+    );
+    $this->drupalPostForm(NULL, $edit, 'Save');
+    $this->assertText('Pattern Page pattern saved.');
+
+    // Create nodes.
+    $this->drupalCreateNode(['type' => 'page', 'title' => 'Llama']);
+    $this->drupalCreateNode(['type' => 'page', 'title' => 'Vicuña']);
+
+    // Enable a menu link for both nodes.
+    $edit = ['menu[enabled]' => 1];
+    $this->drupalGet('node/1/edit');
+    $this->drupalPostForm(NULL, $edit + ['menu[title]' => 'Llama'], 'Save and keep published');
+    $this->drupalGet('node/2/edit');
+    $this->drupalPostForm(NULL, $edit + ['menu[title]' => 'Vicuña'], 'Save and keep published');
+
+    // Test that both nodes have an alias and that it returns a HTTP/200
+    // response.
+    $this->drupalGet('llama');
+    $this->assertResponse(200);
+    $this->drupalGet('vicuna');
+    $this->assertResponse(200);
+
+    // Change the parent menu item of Vicuna to Llama.
+    $this->drupalGet('node/2/edit');
+    // Use xpath to get the value, because the value includes a UUID, and we
+    // can't hardcode that.
+    $llama_option_xml = $this->xpath('//select[@id="edit-menu-menu-parent"]/option[text() = "-- Llama"]/@value');
+    $llama_option = (string) $llama_option_xml[0]->{"value"};
+    $this->drupalPostForm(NULL, ['menu[menu_parent]' => $llama_option], 'Save and keep published');
+
+    // Check that vicuna is now under llama and it returns a HTTP/200 response.
+    $this->drupalGet('llama/vicuna');
+    $this->assertResponse(200);
+
+    // Change the parent menu item back to root.
+    $this->drupalGet('node/2/edit');
+    $this->drupalPostForm(NULL, ['menu[menu_parent]' => 'main:'], 'Save and keep published');
+
+    // Check that vicuna is now under the root again and it returns a HTTP/200
+    // response. The old url should now return a HTTP/404 response.
+    $this->drupalGet('llama/vicuna');
+    $this->assertResponse(404);
+    $this->drupalGet('vicuna');
+    $this->assertResponse(200);
+  }
+
 }
