Block library: noSnippet option for sections repeated on every page
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2a07fb8844
commit
6e6de5d0cc
@@ -237,6 +237,12 @@ describe('block details', () => {
|
||||
warn.mockRestore()
|
||||
})
|
||||
|
||||
test('noSnippet keeps a repeated section out of search snippets', async () => {
|
||||
const map = createBlockRegistry(content, { noSnippet: ['cta'] })
|
||||
expect(await render(h(map.cta, { blockType: 'cta', header, locale: 'en', ...SAMPLES.cta }))).toMatch(/^<div><div data-nosnippet="">/)
|
||||
expect(await render(block('cta'))).not.toContain('data-nosnippet')
|
||||
})
|
||||
|
||||
test('classNames replace one part’s classes', async () => {
|
||||
const map = createBlockRegistry(content, { classNames: { faq: { item: 'my-item' } } })
|
||||
const html = await render(h(map.faq, { blockType: 'faq', locale: 'en', ...SAMPLES.faq }))
|
||||
|
||||
Reference in New Issue
Block a user