From 0c621d365adc61ad3ad4040456320d5768c48d13 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 09:11:51 +0000 Subject: [PATCH] fix(plugin-form): the print row-cap test loads the line grid's body before its first render (#36640) The cut-off case read the row count once, right after the row-ceiling note appeared. The note and the rows commit together, but the grid's body loads on first use (objectstack#36102), and the panel's mount-time preload is not awaited: a grid mounted before that load settles draws its loading face with no table, so the count read 0. Load the body at module scope, as the other line-grid tests do; the assertions are unchanged. Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01JQwxbZPB2pvoCNvwHycJan --- .../src/__tests__/lineItemsPrintRowCap-11958.test.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsx b/ui/packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsx index c0e07ef2abc..bd6a6cef3be 100644 --- a/ui/packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsx +++ b/ui/packages/plugin-form/src/__tests__/lineItemsPrintRowCap-11958.test.tsx @@ -26,9 +26,17 @@ import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, cleanup, waitFor } from '@testing-library/react'; import React from 'react'; import { SchemaRenderer, SchemaRendererProvider, PrintPageProvider } from '@object-ui/react'; +import { preloadGridField } from '@object-ui/fields'; // Registers `record:line_items`. import '../index'; +// The line grid renders behind `@object-ui/fields`' lazy face (objectstack#36102); +// load its body before the first render, as the record forms' mount-time +// preload does in the console. The panel's own mount-time preload is not +// awaited, so without this the cut-off note can commit while the grid still +// draws its loading face, and a row count read beside the note sees no table. +await preloadGridField(); + const COLUMNS = [{ name: 'qty', label: 'Qty', type: 'number' as const }]; const LIMIT = 2;