diff --git a/core/modules/block/src/Tests/BlockAdminThemeTest.php b/core/modules/block/src/Tests/BlockAdminThemeTest.php
index 52a51da..7bcafe8 100644
--- a/core/modules/block/src/Tests/BlockAdminThemeTest.php
+++ b/core/modules/block/src/Tests/BlockAdminThemeTest.php
@@ -42,5 +42,10 @@ function testAdminTheme() {
     $this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
     $this->drupalGet('admin/structure/block/list/bartik');
     $this->assertResponse(200);
+
+    // Ensure that when access is denied, the default theme is shown instead.
+    $this->drupalLogout();
+    $this->drupalGet('admin/structure/block/demo/bartik');
+    $this->assertRaw('core/themes/classy');
   }
 }
