diff --git a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
index dd21f0e..f8b1ee3 100644
--- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
+++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
@@ -48,7 +48,7 @@ public function setUp() {
     $this->getModuleList();

     // Create users.
-    $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions'));
+    $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions', 'administer themes'));
     $this->anyUser = $this->drupalCreateUser(array());
   }

@@ -113,4 +113,31 @@ protected function getModuleList() {
     }
     return $modules;
   }
+
+  /**
+   * Ensures that the help text block is only shown for users with access.
+   */
+  public function testHelpBlockVisibility() {
+    // Log in and test that the settings form for a non-existent theme returns a
+    // 404 and that the help block is not displayed.
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('admin/appearance/settings/' . $this->randomName());
+    $this->assertResponse(404, 'The theme settings form for a non-existent theme could not be found.');
+    $help_block = $this->xpath("//div[@id='block-help']");
+    $this->assertFalse($help_block, 'The help block is not displayed.');
+    $this->drupalLogout();
+
+    // Test a non-existent theme settings form and ensure that it returns a 403
+    // for an unprivileged user and that the help block is not displayed.
+    $this->drupalGet('admin/appearance/settings/' . $this->randomName());
+    $this->assertResponse(403);
+    $help_block = $this->xpath("//div[@id='block-help']");
+    $this->assertFalse($help_block, 'The help block is not displayed.');
+
+    // Test block admin page and ensure the help block is not displayed.
+    $this->drupalGet('admin/structure/block');
+    $this->assertResponse(403);
+    $this->assertFalse($help_block, 'The help block is not displayed.');
+  }
+
 }
