fix(embeds): address Phase 38 review findings in hydration runtime, plugin sync, and docs

This commit is contained in:
Jakub Zych
2026-11-28 13:13:09 +01:00
parent 47de196516
commit 14558e4677
4 changed files with 46 additions and 10 deletions

View File

@@ -244,10 +244,12 @@ test('hydrateEmbedFigure mounts a plain DOM provider, reserves CLS minHeight, pa
let cleanedUp = false
let receivedCtx: Record<string, unknown> | null = null
let attachedDuringMount = false
const registry = createJournalEmbedRegistry({
viz: {
idPattern: /^[a-z0-9-]+$/,
mount(el, ctx) {
attachedDuringMount = (el as unknown as FakeElement).parentNode === fig
receivedCtx = {
id: ctx.id,
provider: ctx.provider,
@@ -272,6 +274,7 @@ test('hydrateEmbedFigure mounts a plain DOM provider, reserves CLS minHeight, pa
})
assert.ok(cleanup, 'expected cleanup function')
assert.equal(attachedDuringMount, true, 'host element must be attached to figure before mount() runs')
// CLS height reservation from measured fallback box (Math.ceil(342.4) = 343px).
assert.equal(fig.style.minHeight, '343px')
assert.equal(fig.classList.contains('journal-embed--hydrated'), true)