test(morfo): fix stale role-hoist assertion + guard the dialog-001 deliberate absence

The dialog-001 a11y-race fix (53b6f629) removed the literal role from dialog
Content on purpose — variant-dependent dialog/alertdialog, DialogContentProvider
is the sole authority — but the compile test kept asserting the static hoist on
that part, red on HEAD since then. Adjudicated: stale test, not a compiler
regression (mechanism verified intact via Title, which does declare a literal
role: heading).

- Re-point the hoist mechanism test at Title (heading).
- New guard: Content emits NO static role, locking dialog-001 against a
  re-declared literal reintroducing the syncAttrs overwrite race.

Suite 35/35 (was 33+1 failed); type baseline 57.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
menubar-v4-safe
dev 3 months ago
parent bf573430b8
commit e8f12aa1dc

@ -114,9 +114,20 @@ describe('compileMorfo — parts', () => {
describe('compileMorfo — staticAttrs vs dynamicAttrs split', () => {
it('hoists role into staticAttrs', () => {
// Title declares a literal `role: 'heading'` — the hoist target.
const compiled = compileMorfo(dialogMorfo)
const title = compiled.parts.byKebab.get('title')!
expect(title.staticAttrs.role).toBe('heading')
})
it('emits NO static role for dialog Content (dialog-001)', () => {
// Content's role is variant-dependent (`dialog` vs `alertdialog`) and the
// DialogContentProvider is its SOLE authority — a morfo-declared literal
// would let syncAttrs' post-render dom.apply overwrite `alertdialog` back
// to `dialog` (the dialog-001 a11y race). Guard the deliberate absence.
const compiled = compileMorfo(dialogMorfo)
const content = compiled.parts.byKebab.get('content')!
expect(content.staticAttrs.role).toBe('dialog')
expect(content.staticAttrs.role).toBeUndefined()
})
it('hoists unconditional literal aria into staticAttrs (not dynamicAttrs)', () => {

Loading…
Cancel
Save

Powered by TurnKey Linux.