This commit is contained in:
@@ -169,3 +169,24 @@ test('help mounts once across portal pages and the simulator publishes its curre
|
||||
/<button[^>]*type="button"[^>]*data-form-help-open/s,
|
||||
);
|
||||
});
|
||||
|
||||
test('modal assistance remains inside the dialog focus scope and leaves form controls mounted', () => {
|
||||
const component = readFileSync(
|
||||
new URL(
|
||||
'../../resources/js/components/form-field-help.tsx',
|
||||
import.meta.url,
|
||||
),
|
||||
'utf8',
|
||||
);
|
||||
assert.match(component, /createPortal\(content, dialog\)/);
|
||||
assert.doesNotMatch(
|
||||
component,
|
||||
/innerHTML|replaceChildren|appendChild|removeChild/,
|
||||
);
|
||||
const dom = readFileSync(
|
||||
new URL('../../resources/js/lib/form-help-dom.ts', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
assert.match(dom, /dialog\[open\]/);
|
||||
assert.doesNotMatch(dom, /cloneNode|\.value\b/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user