fix: preserve exact linked note titles
This commit is contained in:
25
src/components/inspector/shared.test.ts
Normal file
25
src/components/inspector/shared.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { makeEntry } from '../../test-utils/noteListTestUtils'
|
||||
import { resolveRefProps } from './shared'
|
||||
|
||||
describe('resolveRefProps', () => {
|
||||
it('uses the resolved entry title for relationship labels', () => {
|
||||
const linkedTopic = makeEntry({
|
||||
path: '/vault/topic/ai-ml.md',
|
||||
filename: 'ai-ml.md',
|
||||
title: 'AI / ML',
|
||||
isA: 'Topic',
|
||||
})
|
||||
const topicType = makeEntry({
|
||||
path: '/vault/type/topic.md',
|
||||
filename: 'topic.md',
|
||||
title: 'Topic',
|
||||
isA: 'Type',
|
||||
color: 'green',
|
||||
})
|
||||
|
||||
const props = resolveRefProps('[[topic/ai-ml]]', [linkedTopic, topicType], { Topic: topicType })
|
||||
|
||||
expect(props.label).toBe('AI / ML')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user