Skip to content

Add data-testid on main UI controls - #4151

Open
flomillot wants to merge 2 commits into
mainfrom
florent/GRD-5260-data-testid
Open

Add data-testid on main UI controls#4151
flomillot wants to merge 2 commits into
mainfrom
florent/GRD-5260-data-testid

Conversation

@flomillot

@flomillot flomillot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Add data-testid attributes on some buttons, so automated tests can target them.

Area Ids
Workspace toolbar TreePanel, ModificationsPanel, DynamicSimulationPanel, SpreadSheetPanel, ResultsPanel, LogsPanel, ParametersPanel, ImportFromGE, GlobalSearchEquipment, OpenMapView
Workspace switcher WorkSpace, ManageWS, RenameWS, SaveWS, UploadWS, ResetWS (one per workspace, no index)
Panel header PinPanel / UnpinPanel, MaxPanel / MinPanel, ClosePanel
Modifications panel NodeNameModificationPanel, AddModification, CreateComposite, ImportModification, SaveModification, CutModification, CopyModification, PasteModification, DeleteModification, RestoreModification
Modification dialogs OpenCatalog, CopyFromExistingEquipment

Add data-testid attributes to make components easier to target from
automated tests:
- workspace toolbar: panel toggles, GridExplore import, global search,
  map view
- workspace switcher: workspace toggles and management actions
  (rename, save, upload, reset), suffixed with the workspace number
- panel header: pin, maximize and close buttons, following the current
  toggle state
- modifications panel: node name and the whole action toolbar
- modification dialogs: catalog and copy-from-existing buttons

Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16219166-f1ba-4607-b16e-c6a899d2ded7

📥 Commits

Reviewing files that changed from the base of the PR and between ac48e09 and 93be787.

📒 Files selected for processing (1)
  • src/components/workspace/core/workspace-switcher.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/workspace/core/workspace-switcher.tsx

📝 Walkthrough

Walkthrough

Changes

The change adds stable data-testid values to modification, panel, workspace, and toolbar controls. The shared tooltip button hook now accepts an optional test identifier.

UI test identifiers

Layer / File(s) Summary
Shared and modification controls
src/components/utils/inputs/input-hooks.tsx, src/components/dialogs/commons/modification-dialog-content.tsx, src/components/graph/menus/network-modifications/*
The shared button hook accepts dataTestId. Modification dialogs and node editor actions expose test identifiers.
Panel control identifiers
src/components/workspace/core/panel-header.tsx
Pin, maximize, and close buttons expose fixed or state-dependent identifiers.
Workspace controls
src/components/workspace/core/workspace-switcher.tsx, src/components/workspace/core/workspace-toolbar.tsx
Workspace actions and toolbar controls expose fixed test identifiers.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains that the pull request adds data-testid attributes to UI controls for automated testing.
Title check ✅ Passed The title clearly summarizes the main change: adding data-testid attributes to primary UI controls.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant