diff --git a/tests/src/Functional/IntegrationTest.php b/tests/src/Functional/IntegrationTest.php
index 51554be..7401e20 100644
--- a/tests/src/Functional/IntegrationTest.php
+++ b/tests/src/Functional/IntegrationTest.php
@@ -674,6 +674,36 @@ class IntegrationTest extends FacetsTestBase {
   }
 
   /**
+   * Tests the visibility of facet source.
+   */
+  public function testFacetSourceVisibility() {
+    $this->createFacet('Vicuña', 'vicuna');
+    $edit = [
+      'facet_settings[only_visible_when_facet_source_is_visible]' => FALSE,
+    ];
+    $this->drupalPostForm('/admin/config/search/facets/vicuna/edit', $edit, 'Save');
+
+    // Test that the facet source is visible on the search page and user/2 page.
+    $this->drupalGet('search-api-test-fulltext');
+    $this->assertFacetBlocksAppear();
+    $this->drupalGet('user/2');
+    $this->assertFacetBlocksAppear();
+
+    // Change the facet to only show when it's source is visible.
+    $edit = [
+      'facet_settings[only_visible_when_facet_source_is_visible]' => TRUE,
+    ];
+    $this->drupalPostForm('/admin/config/search/facets/vicuna/edit', $edit, 'Save');
+
+    // Test that the facet still apears on the search page but is hidden on the
+    // user page.
+    $this->drupalGet('search-api-test-fulltext');
+    $this->assertFacetBlocksAppear();
+    $this->drupalGet('user/2');
+    $this->assertNoFacetBlocksAppear();
+  }
+
+  /**
    * Configures empty behavior option to show a text on empty results.
    *
    * @param string $facet_name
