mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
test(editor): Stabilize N8nPopover trigger clicks in unit tests (no-changelog) (#33978)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b69cf1a54e
commit
56dd2bfb15
|
|
@ -47,8 +47,15 @@ vi.mock('reka-ui', async (importOriginal) => {
|
|||
const context = inject<{ isOpen: { value: boolean }; setOpen: (v: boolean) => void }>(
|
||||
POPOVER_OPEN_KEY,
|
||||
);
|
||||
// Capture phase avoids Vue's "event fired before listener attached" guard
|
||||
// (`e._vts <= invoker.attached`), which flakily skips a bubble-phase onClick
|
||||
// when a test renders and clicks within the same millisecond.
|
||||
return () =>
|
||||
h('div', { onClick: () => context?.setOpen(!context.isOpen.value) }, slots.default?.());
|
||||
h(
|
||||
'div',
|
||||
{ onClickCapture: () => context?.setOpen(!context.isOpen.value) },
|
||||
slots.default?.(),
|
||||
);
|
||||
},
|
||||
}),
|
||||
PopoverPortal: defineComponent({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user