diff --git a/core/modules/system/src/Tests/Render/AjaxPageStateTest.php b/core/modules/system/src/Tests/Render/AjaxPageStateTest.php index 700c82d..fa3fceb 100644 --- a/core/modules/system/src/Tests/Render/AjaxPageStateTest.php +++ b/core/modules/system/src/Tests/Render/AjaxPageStateTest.php @@ -12,6 +12,13 @@ class AjaxPageStateTest extends WebTestBase { /** + * Modules to install. + * + * @var array + */ + public static $modules = ['node', 'views']; + + /** * User account with all available permissions * * @var \Drupal\Core\Session\AccountInterface @@ -61,20 +68,36 @@ public function testDrupalSettingsIsNotLoaded() { } /** - * Test if multiple libaries can be excluded. + * Test if multiple libraries can be excluded. * - * ajax_page_state[libraries] should be able to support multiple libraries + * The ajax_page_state[libraries] should be able to support multiple libraries * comma separated. */ public function testMultipleLibrariesAreNotLoaded() { $this->drupalGet('node', - ['query' => ['ajax_page_state' => ['libraries' => 'core/drupalSettings']]] + ['query' => ['ajax_page_state' => ['libraries' => 'core/domready,core/drupalSettings']]] + ); + $this->assertResponse(200); + $this->assertNoRaw( + '/core/assets/vendor/domready/ready.min.js', + 'The domready library from core should be excluded from loading.' ); $this->assertNoRaw( '/core/misc/drupalSettingsLoader.js', 'The drupalSettings library from core should be excluded from loading.' ); + + $this->drupalGet('node'); + $this->assertRaw( + '/core/assets/vendor/domready/ready.min.js', + 'The domready library from core should be includes in loading.' + ); + + $this->assertRaw( + '/core/misc/drupalSettingsLoader.js', + 'The drupalSettings library from core should be includes in loading.' + ); } }