Preserve app loading fallback in createDevApp.

Only suspend the lazy BUI CSS import so the app root keeps its built-in loading UI, and lock that behavior down in the mocked render test.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-16 19:09:55 +01:00
parent 846fb1ea57
commit 1c00e25901
2 changed files with 10 additions and 3 deletions
@@ -134,6 +134,11 @@ describe('createDevApp', () => {
});
expect(createRoot).toHaveBeenCalledWith(root);
});
const renderedNode = render.mock.calls[0][0] as any;
expect(renderedNode.props.children).toHaveLength(2);
expect(renderedNode.props.children[0].props.fallback).toBeNull();
expect(renderedNode.props.children[1].props.children).toBe('Test App Root');
});
it('should throw a clear error when the root element is missing', () => {
@@ -108,10 +108,12 @@ export function createDevApp(options: CreateDevAppOptions): void {
ReactDOMPromise.then(ReactDOM => {
const rootNode = (
<Suspense fallback={null}>
<BuiCss />
<>
<Suspense fallback={null}>
<BuiCss />
</Suspense>
{AppRoot}
</Suspense>
</>
);
if ('createRoot' in ReactDOM) {