diff --git a/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.info.yml b/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.info.yml index 7bf373a..b803dd3 100644 --- a/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.info.yml +++ b/core/modules/system/tests/themes/test_subsubtheme/test_subsubtheme.info.yml @@ -4,3 +4,12 @@ description: 'Test theme which uses test_subtheme as the base theme.' version: VERSION core: 8.x base theme: test_subtheme + +libraries-override: + core/drupal.dialog: + js: + misc/dialog/dialog.js: js/subsubtheme-dialog.js + core/jquery.farbtastic: + css: + component: + '@test_basetheme/css/farbtastic.css': css/subsubtheme-farbtastic.css diff --git a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php index a77adfc..addf6d8 100644 --- a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php @@ -161,6 +161,19 @@ public function testBaseThemeLibrariesOverrideInSubTheme() { } /** + * Tests library-override on already overridden libraries. + */ + public function testLibrariesOverrideOverridden() { + // Activate a sub-theme that overrides a library override. + $this->activateTheme('test_subsubtheme'); + + // Assert that effective libraries override is from the test_subsubtheme. + $this->assertNoAssetInLibrary('core/modules/system/tests/themes/test_basetheme/css/farbtastic.css', 'core', 'jquery.farbtastic', 'css'); + $this->assertAssetInLibrary('core/modules/system/tests/themes/test_subsubtheme/css/subsubtheme-farbtastic.css', 'core', 'jquery.farbtastic', 'css'); + $this->assertAssetInLibrary('core/modules/system/tests/themes/test_subsubtheme/js/subsubtheme-dialog.js', 'core', 'drupal.dialog', 'js'); + } + + /** * Tests libraries-extend. */ public function testLibrariesExtend() {