fix(admin): isolate CodeMirror load for chunk-failure tests

- Route CodeEditorField through codeeditor/load so vitest can mock the chunk
- Keep registry expectations for colorpicker/codeeditor without importing the editor SFC

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-13 13:57:16 +01:00
parent e81cfde7b2
commit 1df2e31dea
4 changed files with 30 additions and 15 deletions

View File

@@ -0,0 +1,5 @@
// Separate module so tests can mock the CodeMirror chunk import without
// fighting a prior evaluation of editor.ts in the same vitest worker.
export function importCodeEditor(): Promise<typeof import('./editor')> {
return import('./editor')
}

View File

@@ -84,7 +84,7 @@ onMounted(async () => {
return
}
try {
module = await import('../codeeditor/editor')
module = await (await import('../codeeditor/load')).importCodeEditor()
if (disposed) {
return
}