function ComponentRenderTest::testCssLibraryAttachesCorrectly
Same name in this branch
- 11.x core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php \Drupal\FunctionalJavascriptTests\Components\ComponentRenderTest::testCssLibraryAttachesCorrectly()
Same name in other branches
- 10 core/modules/sdc/tests/src/FunctionalJavascript/ComponentRenderTest.php \Drupal\Tests\sdc\FunctionalJavascript\ComponentRenderTest::testCssLibraryAttachesCorrectly()
- 10 core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php \Drupal\FunctionalJavascriptTests\Components\ComponentRenderTest::testCssLibraryAttachesCorrectly()
Tests that the correct libraries are put on the page using CSS.
This also covers all the path translations necessary to produce the correct path to the assets.
File
-
core/
modules/ sdc/ tests/ src/ FunctionalJavascript/ ComponentRenderTest.php, line 34
Class
- ComponentRenderTest
- Tests the correct rendering of components.
Namespace
Drupal\Tests\sdc\FunctionalJavascriptCode
public function testCssLibraryAttachesCorrectly() {
$build = [
'#type' => 'inline_template',
'#template' => "{{ include('sdc_theme_test:lib-overrides') }}",
];
\Drupal::state()->set('sdc_test_component', $build);
$this->drupalGet('sdc-test-component');
$wrapper = $this->getSession()
->getPage()
->find('css', '#sdc-wrapper');
// Opacity is set to 0 in the CSS file (see another-stylesheet.css).
$this->assertFalse($wrapper->isVisible());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.