Do not override 'headless' assertiveness

Created on 30 April 2025, about 2 months ago

Problem/Motivation

I want to disable Editoria11y when running in test environments unless I want to specifically test for it.

I am using the following configuration override in my settings.php

if (defined('DRUPAL_TEST_IN_CHILD_SITE') && DRUPAL_TEST_IN_CHILD_SITE) {
  // Disable Editoria11y on tests.
  $config['editoria11y.settings']['assertiveness'] = 'headless';

However if my tests load any pages with CKEditor on them, the widget is still visible due to this JS:

let ed11yAlertMode = drupalSettings.editoria11y.assertiveness ? drupalSettings.editoria11y.assertiveness : 'assertive';
  // If assertiveness is "smart" we set it to assertive if the doc was recently changed.
  const now = new Date();
  if (drupalSettings.path.currentPathIsAdmin && (Drupal.editors && (Object.hasOwn(Drupal.editors, 'ckeditor5') || Object.hasOwn(Drupal.editors, 'gutenberg'))) && drupalSettings.editoria11y.assertiveness !== 'polite') {
    ed11yAlertMode = 'active';
  }

Proposed resolution

I believe the JS logic should be changed to drupalSettings.editoria11y.assertiveness === 'smart' based on the code comment.

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Active

Version

2.2

Component

Bugs

Created by

πŸ‡ΊπŸ‡ΈUnited States dave reid Nebraska USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024