From 72dbdcd3e352253b5edeb4cec89c5060064183d8 Mon Sep 17 00:00:00 2001 From: Rebeka Dekany <50901361+rebekadekany@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:07:41 +0200 Subject: [PATCH] Improve selectors to reduce flaky E2E tests (#26413) * Use the leadingIcon prop instead of spacing * Remove duplicated ID * Make the alt text to be empty since image is decorative * Make switcher input visually hidden The switcher's input previously used 'pointer-events: none', which prevented proper interaction in the test. It replaces that hack. * Add accessibilityLabel to the info icon that is actually a clickable link * Use more specific selectors * It should display * Use more specific selectors * Use more specific selectors GitOrigin-RevId: a555d96cf972d06dd5432f44a23b02355cedcd94 --- services/web/frontend/extracted-translations.json | 1 + .../editor-left-menu/components/editor-left-menu.tsx | 1 + .../file-tree-create/file-tree-modal-create-file-mode.tsx | 4 +--- .../history/components/change-list/change-list.tsx | 4 +++- .../js/features/pdf-preview/components/pdf-js-viewer.tsx | 7 ++++++- .../js/features/pdf-preview/components/pdf-logs-viewer.tsx | 1 + .../features/pdf-preview/components/pdf-preview-pane.tsx | 2 +- .../project-list/components/modals/create-tag-modal.tsx | 2 +- .../project-list/components/sidebar/sidebar-ds-nav.tsx | 6 +++++- .../welcome-message-new/welcome-message-link.tsx | 7 +------ .../settings/components/emails/confirm-email-form.tsx | 1 + .../stylesheets/bootstrap-5/pages/editor/toolbar.scss | 4 +--- services/web/locales/en.json | 1 + 13 files changed, 24 insertions(+), 17 deletions(-) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 123ff8e190..cb1da29d7a 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1301,6 +1301,7 @@ "project_files": "", "project_flagged_too_many_compiles": "", "project_has_too_many_files": "", + "project_history_list": "", "project_last_published_at": "", "project_layout_sharing_submission": "", "project_linked_to": "", diff --git a/services/web/frontend/js/features/editor-left-menu/components/editor-left-menu.tsx b/services/web/frontend/js/features/editor-left-menu/components/editor-left-menu.tsx index 40eed9e77e..183e4d1836 100644 --- a/services/web/frontend/js/features/editor-left-menu/components/editor-left-menu.tsx +++ b/services/web/frontend/js/features/editor-left-menu/components/editor-left-menu.tsx @@ -43,6 +43,7 @@ function EditorLeftMenu() { shown: leftMenuShown, })} id="left-menu" + data-testid="left-menu" > diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-create/file-tree-modal-create-file-mode.tsx b/services/web/frontend/js/features/file-tree/components/file-tree-create/file-tree-modal-create-file-mode.tsx index 40a3d7ba9e..eb7e0466f4 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-create/file-tree-modal-create-file-mode.tsx +++ b/services/web/frontend/js/features/file-tree/components/file-tree-create/file-tree-modal-create-file-mode.tsx @@ -2,7 +2,6 @@ import classnames from 'classnames' import { useFileTreeActionable } from '../../contexts/file-tree-actionable' import * as eventTracking from '../../../../infrastructure/event-tracking' import OLButton from '@/features/ui/components/ol/ol-button' -import MaterialIcon from '@/shared/components/material-icon' export default function FileTreeModalCreateFileMode({ mode, @@ -26,9 +25,8 @@ export default function FileTreeModalCreateFileMode({ variant="link" onClick={handleClick} className="modal-new-file-mode" + leadingIcon={icon} > - -   {label} diff --git a/services/web/frontend/js/features/history/components/change-list/change-list.tsx b/services/web/frontend/js/features/history/components/change-list/change-list.tsx index f072d24a57..0078cc2916 100644 --- a/services/web/frontend/js/features/history/components/change-list/change-list.tsx +++ b/services/web/frontend/js/features/history/components/change-list/change-list.tsx @@ -2,12 +2,14 @@ import ToggleSwitch from './toggle-switch' import AllHistoryList from './all-history-list' import LabelsList from './labels-list' import { useHistoryContext } from '../../context/history-context' +import { useTranslation } from 'react-i18next' function ChangeList() { const { labelsOnly, setLabelsOnly } = useHistoryContext() + const { t } = useTranslation() return ( -