feat: show property kind icons

This commit is contained in:
lucaronin
2026-04-16 07:27:11 +02:00
parent 1b10aa9660
commit f8bd3e1b4a
5 changed files with 81 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import { beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
import { fireEvent, render, screen, waitFor } from '@testing-library/react'
import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { DynamicPropertiesPanel } from './DynamicPropertiesPanel'
import type { VaultEntry } from '../types'
import { initDisplayModeOverrides } from '../utils/propertyTypes'
@@ -101,4 +101,17 @@ describe('property type icon control', () => {
expect(screen.queryByDisplayValue('Weekly')).not.toBeInTheDocument()
})
it('shows the relationship icon for relationship-like property rows', () => {
render(
<DynamicPropertiesPanel
entry={makeEntry()}
frontmatter={{ belongs_to: 'Project Alpha' }}
onUpdateProperty={vi.fn()}
/>
)
const row = screen.getByTestId('editable-property')
expect(within(row).getByTestId('display-mode-icon-relationship')).toBeInTheDocument()
})
})