{/* Footer */}
diff --git a/craft/src/ui/CodeEditor.test.tsx b/craft/src/ui/CodeEditor.test.tsx
new file mode 100644
index 0000000..7c8516f
--- /dev/null
+++ b/craft/src/ui/CodeEditor.test.tsx
@@ -0,0 +1,90 @@
+import { describe, test, expect, vi, afterEach } from 'vitest';
+import React from 'react';
+import { createRoot, Root } from 'react-dom/client';
+import { act } from 'react-dom/test-utils';
+import { CodeEditor } from './CodeEditor';
+
+/* ---------- DOM test harness (no @testing-library/react in this repo; see
+ src/ui/AssetPicker.test.tsx / src/ui/Modal.test.tsx for the same
+ react-dom/client + react-dom/test-utils `act` pattern). ----------
+
+ CodeMirror is loaded via dynamic import() (see CodeEditor.tsx), which is
+ always async -- even for an already-resolved/cached module, `import()`
+ only settles on a later microtask. That means immediately after the
+ initial synchronous `act(() => root.render(...))` below, the component is
+ still in its 'loading' state and renders the