feat(blogeditor): support dynamic embed providers, fallbacks, and adaptive form
This commit is contained in:
@@ -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' })],
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user