Project: workspace-doctolib · Branch: HEAD · Mode: ` · **Model:**claude-haiku-4-5-20251001`
Stats: 1 user messages, 21 tool calls, tools used: Read, Bash.
Conversation
Turn 1 — User
Explore the package at /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src. I need to understand the full structure.
Specifically read these files completely: 1. /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/types.ts 2. /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx 3. /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.tsx 4. /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx 5. /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/ (list directory)
Also find and read any existing test files for NhrDocumentListTable components. Search thoroughly with breadth "medium".
Turn 1 — Assistant
I'll help you explore this package structure. Let me start by reading the specified files and finding test files for the components.
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/types.ts
Tool results:
→ result (ok): 1 import type { DesignSystemIconComponent } from '@doctolib/design-system-icons'
2 import type { NhrDocument, NhrResultStatus } from '@doctolib/tpf-national-health-records'
3 import type { ReactNode } from 'react'
4
5 export type NhrPatientInfo = {
6 fullName: string
7 gender: 'male' | 'female' | 'other'
8 birthDate: string
9 age: number
10 }
11
12 export type ColumnConfig = {
13 key: string
14 header: string
15 sortable: boolean
16 /** Only required when sortable: true. Return
…(truncated, 4043 more chars)
Tools used:
Bash:ls -la "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/"
Tools used:
Bash:find "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src" -type f \( -name "*.test.ts" -o -name "*.test.tsx" -o -name "*.spec.ts" -o -name "*.spec.tsx" \)
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/i18n.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/utils/nhrPaginationHelpers.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/utils/nhrDateHelpers.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/tests/index.test.ts /Users/USER/workspace/doctolib/treatmen …(truncated, 6857 more chars)
Tool results:
→ result (ok): drwxr-xr-x clertonra staff 384 B Mon Apr 27 12:01:29 2026 . drwxr-xr-x clertonra staff 224 B Mon Apr 27 12:01:29 2026 .. .rw-r--r-- clertonra staff 3.0 KB Mon Apr 27 12:01:29 2026 ActionButton.test.tsx .rw-r--r-- clertonra staff 691 B Mon Apr 27 12:01:29 2026 ActionButton.tsx .rw-r--r-- clertonra staff 1.9 KB Mon Apr 27 12:01:29 2026 MoreActions.stories.tsx .rw-r--r-- clertonra staff 4.7 KB Mon Apr 27 12:01:29 2026 MoreActions.test.tsx .rw-r--r-- clertonra staff 1.8 KB Mon Apr 27 12:01:29 202 …(truncated, 451 more chars)
Now let me read the three main component files:
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx
Tool results:
→ result (ok): 1 import { PAGE_SIZE } from '#utils/nhrPaginationHelpers'
2 import { Pagination } from '@doctolib/design-system/Pagination'
3 import { Table } from '@doctolib/design-system/Table'
4 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
5
6 import type { ActionConfig, ColumnConfig } from '../../../types'
7 import { NhrDocumentListTableBody } from './NhrDocumentListTableBody/NhrDocumentListTableBody'
8 import { NhrDocumentListTableHead } from './NhrDocumentListTableHead/NhrDocu
…(truncated, 1314 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.tsx
Tool results:
→ result (ok): 1 import { TableHead } from '@doctolib/design-system/TableHead'
2 import { TableHeadCell } from '@doctolib/design-system/TableHeadCell'
3 import { TableHeadSelectAllCell } from '@doctolib/design-system/TableHeadSelectAllCell'
4 import { TableRow } from '@doctolib/design-system/TableRow'
5
6 import type { ColumnConfig } from '../../../../types'
7
8 export type NhrDocumentListTableHeadProps = {
9 columns: ColumnConfig[]
10 }
11
12 export const NhrDocumentListTableHead = ({ columns }: NhrDocum
…(truncated, 661 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx
Tool results:
→ result (ok): 1 import { TableBody } from '@doctolib/design-system/TableBody'
2 import { TableCell } from '@doctolib/design-system/TableCell'
3 import { TableRow } from '@doctolib/design-system/TableRow'
4 import { TableSelectCell } from '@doctolib/design-system/TableSelectCell'
5 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
6
7 import type { ActionConfig, ColumnConfig } from '../../../../types'
8 import { ActionButton } from './ActionButton'
9
10 export type NhrDocumentListTable
…(truncated, 1445 more chars)
Now let me read the test files for these components to understand how they're tested:
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx
Tool results:
→ result (ok): 1 import { setup } from '@doctolib/test-helpers'
2 import { screen } from '@testing-library/react'
3 import { describe, expect, it } from 'vitest'
4
5 import { mockColumns, mockRows } from '../../../test-helpers'
6 import { NhrDocumentListTable } from './NhrDocumentListTable'
7
8 const defaultPaginationProps = {
9 currentPage: 1,
10 total: 0,
11 onPageChange: () => {},
12 }
13
14 describe('NhrDocumentListTable', () => {
15 it('should render a table', () => {
16 setup(<NhrDocumentL
…(truncated, 2331 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.test.tsx
Tool results:
→ result (ok): 1 import { setup } from '@doctolib/test-helpers'
2 import { screen } from '@testing-library/react'
3 import { describe, expect, it } from 'vitest'
4
5 import { mockColumns } from '../../../../test-helpers'
6 import { NhrDocumentListTableHead } from './NhrDocumentListTableHead'
7
8 describe('NhrDocumentListTableHead', () => {
9 it('should render all column header labels from the column config', () => {
10 setup(
11 <table>
12 <NhrDocumentListTableHead columns={mockColumns} /
…(truncated, 1299 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.test.tsx
Tool results:
→ result (ok): 1 import type { DesignSystemIconComponent } from '@doctolib/design-system-icons'
2 import { setup } from '@doctolib/test-helpers'
3 import { screen, waitFor } from '@testing-library/react'
4 import { describe, expect, it, vi } from 'vitest'
5
6 import { createMoreActionsAction } from '../../../../business/factories/actions/createMoreActionsAction'
7 import { mockColumns, mockRows } from '../../../../test-helpers'
8 import { nhrDocumentFixtureBuilder } from '../../../../test-helpers/fixtures/nhr
…(truncated, 6302 more chars)
Now let me check the parent directory structure and look at the overall package structure:
Tools used:
Bash:find "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src" -type f -name "*.tsx" -o -name "*.ts" | head -50 | sort
Tools used:
Bash:ls -la "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/"
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/tests/index.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/business/factories/actions/createMoreActionsAction.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/business/factories/actions/createMoreActionsAction.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/bus …(truncated, 6496 more chars)
Tool results:
→ result (ok): drwxr-xr-x clertonra staff 448 B Mon Apr 27 12:01:29 2026 . drwxr-xr-x clertonra staff 640 B Tue Apr 28 15:41:01 2026 .. drwxr-xr-x clertonra staff 96 B Tue Feb 24 15:53:39 2026 tests drwxr-xr-x clertonra staff 160 B Mon Apr 27 12:01:29 2026 business drwxr-xr-x clertonra staff 352 B Tue Apr 28 15:41:01 2026 components drwxr-xr-x clertonra staff 64 B Tue Apr 21 13:24:58 2026 dev .rw-r--r-- clertonra staff 105 B Tue Mar 10 17:05:01 2026 entry.ts .rw-r--r-- clertonra staff 1.0 KB Thu A …(truncated, 439 more chars)
Let me also read the test-helpers to understand the test data structures:
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/index.ts
Tool results:
→ result (ok): 1 export * from './fixtures' 2
<system-reminder> Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior. </system-reminder>
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/ActionButton.tsx
Tool results:
→ result (ok): 1 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
2
3 import type { ActionConfig } from '../../../../types'
4 import { MoreActions } from './MoreActions'
5 import { SimpleAction } from './SimpleAction'
6
7 type ActionButtonProps = {
8 action: ActionConfig
9 row: NhrDocument
10 }
11
12 export const ActionButton = ({ action, row }: ActionButtonProps) => {
13 if (action.kind === 'dropdown') {
14 const visibleOptions = action.options.filter((opt) => !opt.isAvail
…(truncated, 587 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/MoreActions.tsx
Tool results:
→ result (ok): 1 import { Dropdown } from '@doctolib/design-system/Dropdown'
2 import { DropdownTrigger } from '@doctolib/design-system/DropdownTrigger'
3 import type { IconName } from '@doctolib/design-system/Icon'
4 import { IconButton } from '@doctolib/design-system/IconButton/v2'
5 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
6
7 import type { DropdownActionConfig, DropdownActionOption } from '../../../../types'
8
9 type DropdownOptionProps = {
10 option: DropdownActionOptio
…(truncated, 1881 more chars)
Let me also read SimpleAction and check the fixtures:
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/SimpleAction.tsx
Tool results:
→ result (ok): 1 import { IconButton } from '@doctolib/design-system/IconButton/v2'
2 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
3
4 import type { SimpleActionConfig } from '../../../../types'
5
6 type SimpleActionProps = {
7 action: SimpleActionConfig
8 row: NhrDocument
9 }
10
11 export const SimpleAction = ({ action, row }: SimpleActionProps) => (
12 <IconButton
13 iconComponent={action.iconComponent}
14 tooltip={action.tooltip}
15 variant={action.variant ??
…(truncated, 434 more chars)
Tools used:
Bash:find "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers" -type f
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/index.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/fixtures/nhrPatientInfoFixtureBuilder.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/fixtures/createFixtureBuilder.test.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/ …(truncated, 842 more chars)
Let me read the fixtures and mockData:
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/fixtures/mockData.ts
Tool results:
→ result (ok): 1 import { nhrDocumentFixtureBuilder } from './nhrDocumentFixtureBuilder'
2 import { nhrPatientInfoFixtureBuilder } from './nhrPatientInfoFixtureBuilder'
3
4 export { nhrDocumentListColumns as mockColumns } from '../../components/NhrEntryPoint/nhrDocumentListColumns'
5
6 export const mockPatientInfo = nhrPatientInfoFixtureBuilder()
7
8 export const mockRows = [
9 nhrDocumentFixtureBuilder(),
10 nhrDocumentFixtureBuilder({
11 id: '2',
12 title: 'MRI Brain scan',
13 creationDate
…(truncated, 992 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/fixtures/index.ts
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/test-helpers/fixtures/nhrDocumentFixtureBuilder.ts
Tool results:
→ result (ok): 1 export * from './createFixtureBuilder' 2 export * from './mockData' 3 export * from './nhrDocumentFixtureBuilder' 4 export * from './nhrPatientInfoFixtureBuilder' 5
<system-reminder> Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior. </system-rem …(truncated, 6 more chars)
Tool results:
→ result (ok): 1 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
2
3 import { createFixtureBuilder } from './createFixtureBuilder'
4
5 export const nhrDocumentFixtureBuilder = createFixtureBuilder<NhrDocument>({
6 id: '1',
7 title: 'SOPK test results',
8 creationDate: '2025-01-13',
9 submissionDate: '2025-01-18',
10 status: 'Current',
11 visibility: 'Visible to all',
12 format: 'application/pdf',
13 authors: [{ id: 'doc1', firstName: 'Mario', lastName: 'Casas', role:
…(truncated, 460 more chars)
Perfect! Now let me check the package.json and get a complete picture by looking at the components directory structure:
Tools used:
Bash:find "/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components" -type d | sort
Tools used:
Read:/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/package.json
Tool results:
→ result (ok): 1 {
2 "name": "@doctolib/tpf-national-health-records-ui",
3 "version": "16.0.1",
4 "repository": {
5 "type": "git",
6 "url": "git+https://github.com/doctolib/treatment-plan.git"
7 },
8 "keywords": [
9 "upfront",
10 "modular frontend",
11 "smaller-scope"
12 ],
13 "author": "@doctolib/fire",
14 "license": "Doctolib",
15 "doctolib": {
16 "upfront-type": "smaller-scope"
17 },
18 "type": "module",
19 "sideEffects": [
20 "./src/i18n.ts"
21 ],
22
…(truncated, 4204 more chars)
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDateRangeFilter /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDateSelectionFilter /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NhrDateTypeFilter /Users/USER/workspace/doctolib/treat …(truncated, 2551 more chars)
Excellent! I have thoroughly explored the package. Let me compile a comprehensive report of the structure.
Package Structure Analysis: tpf-national-health-records-ui
Overview
This is a React/TypeScript UI package for the National Health Records (NHR) module in the Treatment Plan & Fulfillment (TPF) application. It's a "smaller-scope" UpFront package designed to display and manage healthcare documents in a modal-based interface.
Package Details:
- Name: @doctolib/tpf-national-health-records
- Version: 16.0.1
- Type: ESM module with TypeScript
- Market Coverage: Both France and Germany (implied by locale setup)
- Team: @doctolib/fire
Directory Structure
Root-Level Organization (/src)
src/
├── __tests__/ # Integration test suite
├── business/ # Business logic, factories, formatters
│ ├── factories/ # Factory functions for creating configurations
│ │ ├── actions/ # Action factories (view, download, etc.)
│ │ ├── columns/ # Column factories (category, name, date, etc.)
│ │ └── filters/ # Filter configuration factories
│ └── formatters/ # Data transformation utilities
├── components/ # React components
│ ├── NhrDocumentListModal/ # Main modal container
│ │ ├── NhrDocumentListHeader/ # Header section with title/metadata
│ │ ├── NhrDocumentListTable/ # Core table component (your focus)
│ │ │ ├── NhrDocumentListTableHead/
│ │ │ └── NhrDocumentListTableBody/
│ │ │ ├── ActionButton.tsx # Dispatches simple vs dropdown actions
│ │ │ ├── SimpleAction.tsx # Single icon button action
│ │ │ └── MoreActions.tsx # Dropdown menu for multiple actions
│ │ └── NhrDocumentListFilterPanel/ # Filter UI controls
│ ├── NhrDocumentList/ # Document list wrapper with cells
│ │ ├── NhrDocumentCategoryCell/ # Cell renderers
│ │ ├── NhrDocumentNameCell/
│ │ ├── NhrProcedureDateCell/
│ │ ├── NhrShareDateCell/
│ │ ├── NhrSharedByCell/
│ │ ├── NhrStatusCell/
│ │ ├── NhrVisibilityCell/
│ │ ├── NhrDocumentStatusFilter/
│ │ └── NhrDocumentCategoryFilter/
│ ├── NhrEntryPoint/ # Main public component + column config
│ ├── NhrEntryPointButton/ # Trigger button
│ ├── NhrDateRangeFilter/ # Date range picker filter
│ ├── NhrDateSelectionFilter/ # Date selection variant
│ ├── NhrDateTypeFilter/ # Filter by date type
│ └── NhrDocumentVisibilityFilter/ # Visibility filter component
├── data/ # (Not visible in provided scope but referenced in imports)
├── locales/ # Translation files
├── test-helpers/ # Test fixtures and utilities
│ └── fixtures/
│ ├── nhrDocumentFixtureBuilder.ts
│ ├── nhrPatientInfoFixtureBuilder.ts
│ └── mockData.ts
├── utils/ # Utility functions
│ ├── nhrPaginationHelpers.ts
│ └── nhrDateHelpers.ts
├── types.ts # Core type definitions (CRITICAL FILE)
├── i18n.ts # Internationalization setup
├── entry.ts # Webpack module federation entry
└── index.ts # Package exports
Core Type System (/src/types.ts)
The package is heavily type-driven. Key types:
-
NhrPatientInfo - Patient demographics (name, gender, birthDate, age)
-
ColumnConfig - Extensible column definition system: -
key: unique identifier -header: display label -sortable: boolean +sortAccessor(locale-aware string) -render: function to render cell content fromNhrDocument -
FilterConfig - Generic filter system: - Render function receives filters state + onChange callback + context - Extensible via
Record<string, unknown>for any filter shape -
ActionConfig - Two variants via discriminated union: - SimpleActionConfig: single icon button with onClick - DropdownActionConfig: icon button opening dropdown with options - Each option can be conditionally available via
isAvailable(doc) -
SearchDocumentsResult - API response envelope: -
data: array ofNhrDocument-status,message,codefor result handling -totalfor pagination
NhrDocumentListTable Component Hierarchy
NhrDocumentListTable (Main Container)
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx
- Purpose: Wraps pagination + table with flex layout
- Props:
columns: ColumnConfig[]- column definitionsrows?: NhrDocument[]- document dataactions?: ActionConfig[]- row action buttonsisLoading?: boolean- skeleton statecurrentPage, onPageChange, total- pagination state- Test Coverage: 4 specs
- Renders table element
- Renders all column headers from config
- Renders skeleton when loading (8 skeleton rows)
- Renders rows using column render functions
- Renders pagination
NhrDocumentListTableHead (Column Headers)
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.tsx
- Purpose: Renders
<TableHead>with static select-all checkbox + column headers - Props:
columns: ColumnConfig[] - Design System: Uses
@doctolib/design-systemcomponents: TableHead,TableRow,TableHeadCell,TableHeadSelectAllCell- Current State: Checkbox onChange is a no-op (
onChange={() => {}}) - Test Coverage: 2 specs
- Renders all column header labels
- Renders select-all checkbox
NhrDocumentListTableBody (Data Rows)
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx
- Purpose: Renders
<TableBody>with optional skeleton loading, row data, or empty state - Props:
columns: ColumnConfig[]isLoading: booleanrows: NhrDocument[]actions?: ActionConfig[]- Structure:
- Skeleton loader when
isLoading=true(8 rows, +2 for checkbox + actions column) - Data rows: checkbox cell + column cells (via render functions) + actions cell
- Actions cell: maps ActionConfig array to ActionButton components
- Test Coverage: 11 specs
- Skeleton rendering
- Data row rendering
- Empty state handling
- Action buttons (simple and dropdown variants)
- Callback invocation with correct document
- Conditional action availability
Action Rendering Components
ActionButton
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/ActionButton.tsx
- Dispatcher component that routes to SimpleAction or MoreActions
- Filters dropdown options by
isAvailable(doc)predicate - Returns
nullif no options are visible
SimpleAction
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/SimpleAction.tsx
- Renders single
IconButton(v2 from design-system) - onClick handler:
action.onClick(row) - Props:
action: SimpleActionConfig,row: NhrDocument
MoreActions
File: /src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/MoreActions.tsx
- Renders
DropdownTriggerwithIconButtontrigger - Dropdown content: maps options to
DropdownOptioncomponents DropdownOption: rendersDropdown.ButtonorDropdown.Itembased onuiStyle- Icons rendered from
option.iconComponent(DesignSystemIconComponent) - onClick handler:
option.onClick(doc)
Test Data & Fixtures
Test Helpers Structure
Location: /src/test-helpers/fixtures/
mockData.ts
- Exports
mockPatientInfo: Patient with defaults - Exports
mockRows: 3 Nh …(truncated, 6442 more chars)