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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user