Skip to content

chore: add data-testid attributes to workspace home, sidebar, and app shell (#1044)#1055

Merged
sw-factory-automations merged 1 commit into
mainfrom
feat/1044-add-data-testid-attributes
May 12, 2026
Merged

chore: add data-testid attributes to workspace home, sidebar, and app shell (#1044)#1055
sw-factory-automations merged 1 commit into
mainfrom
feat/1044-add-data-testid-attributes

Conversation

@sw-factory-automations
Copy link
Copy Markdown
Collaborator

Closes #1044

What

Adds data-testid attributes to key interactive elements in workspace home, sidebar, and app shell components. Updates 25 E2E test files to prefer data-testid selectors over broad getByRole selectors.

Why

E2E tests outside the database domain relied on role-based selectors without scoping to a specific container. When new UI elements were added, these selectors matched multiple elements causing "strict mode violation" errors (root cause of #1042, #998, #916, #835, #780).

Changes

Component attributes added:

  • workspace-home.tsxwh-header, wh-new-page-btn, wh-new-database-btn, wh-filter-input, wh-sort-dropdown, wh-recently-visited, wh-all-pages, wh-page-item-{id}, wh-recent-item-{id}
  • sidebar/page-tree.tsxsb-page-tree, sb-new-page-btn, sb-new-database-btn
  • sidebar/app-sidebar.tsxas-sidebar, as-sidebar-toggle
  • sidebar/app-shell.tsxas-shell
  • sidebar/workspace-switcher.tsxas-workspace-switcher
  • sidebar/page-search.tsxas-search-input
  • sidebar/user-menu.tsxas-user-menu

E2E test updates (25 files):

Replaced getByRole("button", { name: /new page/i })getByTestId("sb-new-page-btn") and similar for all workspace-home and sidebar selectors across: workspace-home, workspace-home-mobile-header, workspace-home-new-database, page-crud, favorites, trash, search, accessibility, sidebar-responsive, mobile-responsive, and 15 database test files.

Testing

  • pnpm lint — 0 errors
  • pnpm typecheck — clean
  • pnpm test — 1877 tests passed (139 files)
  • E2E tests using new selectors pass; intermittent auth timeout failures are pre-existing and unrelated to this change
  • No behavior changes — pure attribute addition + selector migration

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment May 12, 2026 2:39pm

Request Review

@sw-factory-automations
Copy link
Copy Markdown
Collaborator Author

sw-factory-automations commented May 12, 2026

[shepherd] CI has been pending for >30 minutes — the visual check was stuck in progress since ~14:41 UTC (~1.5 hours). Cancelled the stuck run and re-triggered failed jobs. The visual check is now re-running.

@sw-factory-automations sw-factory-automations merged commit bb198d2 into main May 12, 2026
12 of 14 checks passed
@sw-factory-automations sw-factory-automations deleted the feat/1044-add-data-testid-attributes branch May 12, 2026 16:33
@sw-factory-automations
Copy link
Copy Markdown
Collaborator Author

✅ Post-merge verification skipped — chore: PRs don't affect the live app. No smoke tests needed.

@sw-factory-automations
Copy link
Copy Markdown
Collaborator Author

✅ UI verification passed — design spec compliance confirmed.

Summary:

  • Changed UI files: 7 components (workspace-home, app-shell, app-sidebar, page-search, page-tree, user-menu, workspace-switcher)
  • Nature of changes: Exclusively data-testid attribute additions — no CSS, layout, or structural modifications
  • Static analysis: No design spec violations (no visual properties were changed)
  • Storybook visual regression: All 744 snapshots passed with zero diffs
  • Live site screenshots: Skipped — data-testid attributes have no visual impact

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.

chore: add data-testid attributes to workspace home, sidebar, and app shell components

1 participant