fix(embeds): address Phase 38 review findings in hydration runtime, plugin sync, and docs
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user