feat: data-testid on Cn* components for journeydoc capture specs - #225
Merged
Conversation
Adds stable data-testid selectors to the high-traffic Cn* shell components so the journeydoc capture spec (ADR-030) on every Tier-4 Conduction app can target them without per-app instrumentation. The decidesk journeydoc pilot (ConductionNL/decidiq#195) found that most app chrome is rendered by @conduction/nextcloud-vue components, so doing this once in the lib helps every app at once. Purely additive — zero behaviour or styling impact, per the journeydoc-instrument convention. Testids follow the "cn-<scope>-<element>" naming convention from the journeydoc-instrument SKILL.md guide. Components instrumented (by surface): - Shell: CnAppRoot, CnAppNav, CnAppLoading, CnDependencyMissing - Pages: CnPageRenderer, CnPageHeader, CnIndexPage, CnDetailPage, CnDashboardPage, CnSettingsPage, CnSettingsSection, CnFormPage, CnLogsPage, CnFilesPage, CnMapPage, CnWikiPage, CnChatPage - Lists: CnDataTable (table + rows + empty) - Sidebar: CnObjectSidebar (root + each built-in tab + registry tabs + consumer tabs) - Modals: CnFormDialog, CnDeleteDialog, CnCopyDialog, CnAdvancedFormDialog, CnTabbedFormDialog, CnMassDelete/Copy/Export/Import, CnSuggestFeatureModal, CnAiHistoryDialog - Actions: CnActionsBar (+ primary CTA + overflow menu), CnContextMenu, CnRowActions (per-item testid slugged from label), CnUserActionMenu - Filter: CnFilterBar, CnPagination - AI: CnAiCompanion, CnAiChatPanel, CnAiFloatingButton, CnAiInput, CnAiMessageList - Banners: CnLockedBanner
Contributor
|
🎉 This PR is included in version 1.0.0-beta.43 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds stable
data-testid="cn-…-…"selectors to the high-traffic Cn* shell components so the journeydoc capture spec (ADR-030) on every Tier-4 Conduction app can target them without per-app instrumentation. Found in the decidesk pilot (ConductionNL/decidiq#195) where most chrome turned out to be@conduction/nextcloud-vue. Purely additive — zero behaviour or styling impact, per the journeydoc-instrument convention.Components touched
Shell
CnAppRoot→cn-app-rooton<NcContent>;cn-app-root-capabilities-loadingon the phase-0a spinner divCnAppNav→cn-navon<NcAppNavigation>;cn-nav-entry-${item.id}on each main/child/settings entry;cn-nav-footeron the settings<ul>CnAppLoading→cn-app-loadingon the rootCnDependencyMissing→cn-dependency-missingon the rootPages
CnPageRenderer→cn-page+data-testid-page-idon the dispatch wrapperCnPageHeader→cn-page-header,cn-page-title,cn-page-descriptionCnIndexPage→cn-index-pageCnDetailPage→cn-detail-page,cn-detail-page-headerCnDashboardPage→cn-dashboard-page,cn-dashboard-page-headerCnSettingsPage→cn-settings-page,cn-settings-page-tabs,cn-settings-page-tab-${tab.id}per tabCnSettingsSection→cn-settings-sectionCnFormPage→cn-form-pageCnLogsPage→cn-logs-pageCnFilesPage→cn-files-pageCnMapPage→cn-map-pageCnWikiPage→cn-wiki-pageCnChatPage→cn-chat-pageLists
CnDataTable→cn-object-liston the container,cn-object-list-loading,cn-object-list-table,cn-object-list-empty,cn-object-row+data-testid-row-idper rowObject sidebar
CnObjectSidebar→cn-object-sidebaron the root<NcAppSidebar>;cn-object-sidebar-tab-{files,notes,tags,tasks,audit-trail}on the built-in tabs;cn-object-sidebar-tab-${id}for registry-driven and consumer tabsModals / dialogs —
cn-modal+data-testid-modal+data-testid-phaseon the visible inner section (one per phase: form/result/review/confirm/loading/list). Sits inside the dialog body, not on the teleported NcDialog root, so Playwright selectors are reliable.CnFormDialog,CnDeleteDialog,CnCopyDialog,CnAdvancedFormDialog,CnTabbedFormDialog,CnMassDeleteDialog,CnMassCopyDialog,CnMassExportDialog,CnMassImportDialog,CnSuggestFeatureModal,CnAiHistoryDialogActions
CnActionsBar→cn-actions-baron the root,cn-cta-primaryon the Add button,cn-actionson the overflow<NcActions>CnContextMenu→cn-context-menuon<NcActions>;cn-action-item-${slug(label)}on each<NcActionButton>CnRowActions→cn-row-actionson<NcActions>;cn-action-item-${slug(label)}on each<NcActionButton>CnUserActionMenu→cn-user-action-menuon the root<span>Filter / pagination
CnFilterBar→cn-filter-bar,cn-filter-bar-searchCnPagination→cn-paginationAI Chat Companion
CnAiCompanion→cn-ai-companionon the wrapperCnAiChatPanel→cn-ai-panelon<NcAppSidebar>;cn-ai-panel-tab-chaton the chat tabCnAiFloatingButton→cn-ai-fabCnAiInput→cn-ai-input,cn-ai-input-textarea,cn-ai-input-sendCnAiMessageList→cn-ai-message-listBanners
CnLockedBanner→cn-locked-bannerConventions
<scope>-<element>, lowercase, kebab-case,cn-prefix (lib's namespace), per ADR-030 §4 / journeydoc-instrument SKILL.md:data-testid="+ template literal (e.g.cn-nav-entry-${item.id}); for action menus, the action label is slugified by a smallslugifyLabel()method in the same SFC (CnContextMenu, CnRowActions)Verification
npm run lint→ 0 errors (297 warnings, all pre-existing jsdoc nits unrelated to this change)npm test→ all 1267 tests pass across 89 suites; no snapshot updates (the repo has no snapshot tests)Snapshot tests
Unchanged — none exist in this repo.
Skipped
CnAppRoot's alternate phases (or-missing / loading / dependency-missing / user-settings dialog) — only the outermost root + Phase-0a get testids; the other phases already have dedicated single-purpose components (CnAppLoading,CnDependencyMissing) that are instrumented in their own files.🤖 Generated with Claude Code