function AjaxPageStateTest::testHtml5ShivIsNotLoaded

Give ajax_page_state[libraries]=core/html5shiv to exclude the library.

When called with ajax_page_state[libraries]=core/html5shiv the library should be excluded as it is already loaded. This should not affect other libraries so test if drupalSettings is still available.

File

core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php, line 69

Class

AjaxPageStateTest
Performs tests for the effects of the ajax_page_state query parameter.

Namespace

Drupal\Tests\system\Functional\Render

Code

public function testHtml5ShivIsNotLoaded() {
    $this->drupalGet('node', [
        "query" => [
            'ajax_page_state' => [
                'libraries' => 'core/html5shiv',
            ],
        ],
    ]);
    $this->assertNoRaw('/core/assets/vendor/html5shiv/html5shiv.min.js', 'The html5shiv library from core should be excluded from loading');
    $this->assertRaw('/core/misc/drupalSettingsLoader.js', 'The drupalSettings library from core should be loaded.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.