feat(blogeditor): support dynamic embed providers, fallbacks, and adaptive form

This commit is contained in:
Jakub Zych
2026-11-28 12:44:52 +01:00
parent 55ac26e0d3
commit 37e89e56db
9 changed files with 808 additions and 133 deletions

View File

@@ -25,11 +25,16 @@ function openOutline(el: HTMLElement): HTMLElement {
describe('options', () => {
it('reads headingLevels and genericAnchors with defaults', () => {
expect(readOptions(null)).toEqual({ headingLevels: [2, 3, 4], genericAnchors: expect.arrayContaining(['click here', 'czytaj więcej']) })
expect(readOptions(null)).toEqual({
headingLevels: [2, 3, 4],
genericAnchors: expect.arrayContaining(['click here', 'czytaj więcej']),
embedProviders: [expect.objectContaining({ key: 'youtube', mode: 'url' })],
})
expect(readOptions('not json').headingLevels).toEqual([2, 3, 4])
expect(readOptions(JSON.stringify({ headingLevels: [4, 1, 9, 'x', 2.5, 2], genericAnchors: [' Read More! ', 3] }))).toEqual({
headingLevels: [1, 2, 4],
genericAnchors: ['read more'],
embedProviders: [expect.objectContaining({ key: 'youtube', mode: 'url' })],
})
})
})