pull/5162/head
Marco Roth 3 weeks ago
parent bbbb914b88
commit 21caa6511c
No known key found for this signature in database
GPG Key ID: 752AA13248B5D2D6

@ -0,0 +1,7 @@
---
title: Frontmatter Title Resolved
---
# {{ $frontmatter.title }}
This page uses a frontmatter title expression.

@ -28,4 +28,24 @@ describe('local search', () => {
.count()
).toBe(0)
})
test('resolve $frontmatter expressions in search results', async () => {
await page.locator('.VPNavBarSearchButton').click()
const input = await page.waitForSelector('input#localsearch-input')
await input.type('Frontmatter Title Resolved')
await page.waitForSelector('ul#localsearch-list', { state: 'visible' })
const searchResults = page.locator('#localsearch-list')
expect(
await searchResults
.filter({ hasText: 'Frontmatter Title Resolved' })
.count()
).toBe(1)
expect(
await searchResults.filter({ hasText: '$frontmatter.title' }).count()
).toBe(0)
})
})

Loading…
Cancel
Save