diff --git a/src/Tests/UrlIntegrationTest.php b/src/Tests/UrlIntegrationTest.php
index bfb7614..f98e7d1 100644
--- a/src/Tests/UrlIntegrationTest.php
+++ b/src/Tests/UrlIntegrationTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\facets\Tests;
 
+use Drupal\Core\Url;
 use \Drupal\facets\Tests\WebTestBase as FacetWebTestBase;
 
 /**
@@ -65,25 +66,53 @@ class UrlIntegrationTest extends FacetWebTestBase {
     $this->drupalPostForm(NULL, ['facet_source_id' => 'search_api_views:search_api_test_view:page_1'], $this->t('Configure facet source'));
     $this->drupalPostForm(NULL, $form_values, $this->t('Save'));
 
-    // Go to the only enabled facet source's config.
+    $block_values = [
+      'plugin_id' => 'facet_block:' . $id,
+      'settings' => [
+        'region' => 'footer',
+        'id' => str_replace('_', '-', $id),
+      ]
+    ];
+    $this->drupalPlaceBlock($block_values['plugin_id'], $block_values['settings']);
+
+    $url = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['f[0]' => 'facet:item']]);
+    $this->checkClickedFacetUrl($url);
+
+    // Go to the only enabled facet source's config and change the filter key.
     $this->drupalGet('admin/config/search/facets');
     $this->clickLink($this->t('Configure'));
 
     $edit = [
       'filterKey' => 'y',
-      'urlProcessor' => 'dummy_query',
+      'urlProcessor' => 'query_string',
     ];
     $this->drupalPostForm(NULL, $edit, $this->t('Save'));
 
-    $block_values = [
-      'plugin_id' => 'facet_block:' . $id,
-      'settings' => [
-        'region' => 'footer',
-        'id' => str_replace('_', '-', $id),
-      ]
+    $url_2 = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['y[0]' => 'facet:item']]);
+    $this->checkClickedFacetUrl($url_2);
+
+    // Go to the only enabled facet source's config and change the url
+    // processor.
+    $this->drupalGet('admin/config/search/facets');
+    $this->clickLink($this->t('Configure'));
+
+    $edit = [
+      'filterKey' => 'y',
+      'urlProcessor' => 'dummy_query',
     ];
-    $this->drupalPlaceBlock($block_values['plugin_id'], $block_values['settings']);
+    $this->drupalPostForm(NULL, $edit, $this->t('Save'));
 
+    $url_3 = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['y[0]' => 'facet||item']]);
+    $this->checkClickedFacetUrl($url_3);
+  }
+
+  /**
+   * Checks that the url after clicking a facet is as expected.
+   *
+   * @param \Drupal\Core\Url $url
+   *   The expected url we end on.
+   */
+  protected function checkClickedFacetUrl(Url $url) {
     $this->drupalGet('search-api-test-fulltext');
     $this->assertResponse(200);
     $this->assertLink('item');
@@ -94,7 +123,7 @@ class UrlIntegrationTest extends FacetWebTestBase {
     $this->assertResponse(200);
     $this->assertLink('(-) item');
     $this->assertNoLink('article');
-    $this->assertUrl('search-api-test-fulltext', ['query' => ['y[0]' => 'facet||item']]);
+    $this->assertUrl($url);
   }
 
 }
