Skip to content

EDM-3810: Add data-testid hooks for Cypress E2E#635

Open
talhil-rh wants to merge 2 commits intoflightctl:mainfrom
talhil-rh:add-data-testids
Open

EDM-3810: Add data-testid hooks for Cypress E2E#635
talhil-rh wants to merge 2 commits intoflightctl:mainfrom
talhil-rh:add-data-testids

Conversation

@talhil-rh
Copy link
Copy Markdown
Collaborator

@talhil-rh talhil-rh commented Apr 30, 2026

Stable selectors for fleets, repositories, devices, masthead, and shared table controls aligned with flightctl-ui-tests flows.

Made-with: Cursor

Summary by CodeRabbit

  • Chores
    • Enhanced test infrastructure by adding deterministic test identifiers across UI components for improved automated testing capabilities. Updated component structures to support stable test targeting without affecting user-facing functionality or behavior.

Stable selectors for fleets, repositories, devices, masthead, and shared
table controls aligned with flightctl-ui-tests flows.

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@talhil-rh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 21 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6cfbc4f4-5252-462c-8df0-ac74429510e0

📥 Commits

Reviewing files that changed from the base of the PR and between 388945b and 15255b5.

📒 Files selected for processing (1)
  • libs/ui-components/src/components/Fleet/FleetRow.tsx

Walkthrough

This change adds data-testid attributes across multiple UI components for E2E testing support. Some components refactor test ID naming from index-based to name/device-based approaches, and one component introduces a new optional prop for passing test IDs. Functional behavior remains unchanged.

Changes

Cohort / File(s) Summary
Device Components
libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx, libs/ui-components/src/components/Device/DevicesPage/EnrolledDeviceTableRow.tsx
Added data-testid attributes to device actions. EnrolledDeviceTableRow refactored to construct typed actionItems array with conditional inclusion and changed test ID from row-index to device-name based naming.
Fleet Components
libs/ui-components/src/components/Fleet/FleetDetails/FleetDetailsPage.tsx, libs/ui-components/src/components/Fleet/FleetRow.tsx, libs/ui-components/src/components/Fleet/FleetsPage.tsx, libs/ui-components/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.tsx
Added data-testid attributes to fleet-related UI elements (menu items, buttons, links, cells). FleetRow added type casting for action objects. GeneralInfoStep added labelGroupTestId prop to LabelsField.
Repository Components
libs/ui-components/src/components/Repository/RepositoryList.tsx, libs/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx
Added data-testid attributes to repository actions. RepositoryList refactored test IDs from index-based to name-based and simplified casting in ResourceLink.
UI Utilities & Modal
libs/ui-components/src/components/form/LabelsField.tsx, libs/ui-components/src/components/Table/Table.tsx, libs/ui-components/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.tsx, apps/standalone/src/app/components/AppLayout/AppToolbar.tsx
LabelsField added new optional labelGroupTestId prop to enable test targeting. Table, modal, and toolbar components added data-testid attributes to enable deterministic UI test selection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding data-testid attributes for Cypress E2E testing across multiple UI components.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 0/1 reviews remaining, refill in 23 minutes and 21 seconds.

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

@talhil-rh
Copy link
Copy Markdown
Collaborator Author

cc @celdrake

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.

2 participants