feat: show property kind icons
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ComponentProps } from 'react'
|
||||
import { describe, it, expect, vi, beforeEach, beforeAll } from 'vitest'
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/react'
|
||||
import { render, screen, fireEvent, waitFor, within } from '@testing-library/react'
|
||||
import { DynamicPropertiesPanel, containsWikilinks } from './DynamicPropertiesPanel'
|
||||
import type { VaultEntry } from '../types'
|
||||
import { bindVaultConfigStore, getVaultConfig, resetVaultConfigStore } from '../utils/vaultConfigStore'
|
||||
@@ -125,6 +125,16 @@ describe('DynamicPropertiesPanel', () => {
|
||||
expect(screen.getByText('Note')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows the shared type icon in the type row label', () => {
|
||||
renderPanel({
|
||||
content: '# Test\n\nSome words here',
|
||||
frontmatter: { Status: 'Active' },
|
||||
onUpdateProperty,
|
||||
})
|
||||
|
||||
expect(screen.getByTestId('type-row-icon')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('renders status as colored pill', () => {
|
||||
renderPanel({ frontmatter: { Status: 'Active' } })
|
||||
// Status rendered as sentence case
|
||||
@@ -438,6 +448,15 @@ describe('DynamicPropertiesPanel', () => {
|
||||
expect(screen.getByText('Icon')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('shows a property-kind icon for each suggested slot', () => {
|
||||
renderPanel({ onAddProperty })
|
||||
|
||||
expect(within(findSuggestedSlot('Status')).getByTestId('suggested-property-icon-status')).toBeInTheDocument()
|
||||
expect(within(findSuggestedSlot('Date')).getByTestId('suggested-property-icon-date')).toBeInTheDocument()
|
||||
expect(within(findSuggestedSlot('URL')).getByTestId('suggested-property-icon-url')).toBeInTheDocument()
|
||||
expect(within(findSuggestedSlot('Icon')).getByTestId('suggested-property-icon-text')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('hides Status slot when Status property already exists', () => {
|
||||
renderPanel({
|
||||
frontmatter: { Status: 'Active' },
|
||||
|
||||
Reference in New Issue
Block a user