Skip to content
Snippets Groups Projects
Unverified Commit 7578516f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3231416 by mherchel, ankithashetty, Gauravmahlawat, chetanbharambe,...

Issue #3231416 by mherchel, ankithashetty, Gauravmahlawat, chetanbharambe, davidwbarratt: Olivero should not expect its default menu blocks to always exist
parent ec2c23d6
No related branches found
No related tags found
No related merge requests found
/**
* @file
* Log all errors.
*/
Drupal.errorLog = [];
window.addEventListener('error', (e) => {
Drupal.errorLog.push(e);
});
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
Drupal.errorLog = [];
window.addEventListener('error', function (e) {
Drupal.errorLog.push(e);
});
\ No newline at end of file
log-errors:
js:
js/log-errors.js: { weight: -15 }
dependencies:
- core/drupal
......@@ -14,3 +14,10 @@ function olivero_test_preprocess_field_multiple_value_form(&$variables) {
$variables['element']['#disabled'] = TRUE;
}
}
/**
* Implements hook_preprocess_html().
*/
function olivero_test_preprocess_html(&$variables) {
$variables['#attached']['library'][] = 'olivero_test/log-errors';
}
module.exports = {
'@tags': ['core', 'olivero'],
before(browser) {
browser
.drupalInstall({
setupFile:
'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php',
installProfile: 'minimal',
})
.drupalLoginAsAdmin(() => {
browser
.drupalRelativeURL('/admin/structure/block')
// Disable narrow search form block.
.click(
'[data-drupal-selector="edit-blocks-olivero-search-form-narrow-operations"] .dropbutton-toggle button',
)
.click('[href*="olivero_search_form_narrow/disable"]')
// Disable main menu block.
.click(
'[data-drupal-selector="edit-blocks-olivero-main-menu-operations"] .dropbutton-toggle button',
)
.click('[href*="olivero_main_menu/disable"]')
// Disable wide search form block.
.click(
'[data-drupal-selector="edit-blocks-olivero-search-form-wide-operations"] .dropbutton-toggle button',
)
.click('[href*="olivero_search_form_wide/disable"]')
// Disable user account menu block.
.click(
'[data-drupal-selector="edit-blocks-olivero-account-menu-operations"] .dropbutton-toggle button',
)
.click('[href*="olivero_account_menu/disable"]');
});
},
after(browser) {
browser.drupalUninstall();
},
'Verify no console errors': (browser) => {
browser
.drupalRelativeURL('/')
.waitForElementVisible('body')
.execute(
// eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow
function () {
return Drupal.errorLog.length === 0;
},
[],
(result) => {
browser.assert.ok(result.value, 'Verify no console errors exist.');
},
);
},
};
......@@ -40,10 +40,6 @@ global-styling:
css/components/links.css: {}
css/components/messages.css: {}
css/components/navigation/nav-button-mobile.css: {}
css/components/navigation/nav-primary-button.css: {}
css/components/navigation/nav-primary.css: {}
css/components/navigation/nav-primary-wide.css: {}
css/components/navigation/nav-secondary.css: {}
css/components/node.css: {}
css/components/node-teaser.css: {}
css/components/page-title.css: {}
......@@ -58,8 +54,7 @@ global-styling:
js:
js/checkbox.js: {}
js/navigation-utils.js: {}
js/navigation.js: {}
js/second-level-navigation.js: {}
dependencies:
- core/drupal.element.closest
- core/drupal.element.matches
......@@ -213,6 +208,23 @@ messages:
js:
js/messages.js: {}
navigation-primary:
version: VERSION
css:
component:
css/components/navigation/nav-primary.css: {}
css/components/navigation/nav-primary-button.css: {}
css/components/navigation/nav-primary-wide.css: {}
js:
js/navigation.js: {}
js/second-level-navigation.js: {}
navigation-secondary:
version: VERSION
css:
component:
css/components/navigation/nav-secondary.css: {}
powered-by-block:
version: VERSION
css:
......
......@@ -20,6 +20,8 @@
* @ingroup themeable
*/
#}
{{ attach_library('olivero/navigation-primary') }}
{% import _self as menus %}
{#
......
......@@ -20,6 +20,8 @@
* @ingroup themeable
*/
#}
{{ attach_library('olivero/navigation-secondary') }}
{% import _self as menus %}
{#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment