fix: preserve exact linked note titles

This commit is contained in:
lucaronin
2026-04-14 17:32:47 +02:00
parent 9041246a32
commit 084d3d9c71
4 changed files with 65 additions and 5 deletions

View 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')
})
})