Skip to content

Commit 9c82809

Browse files
committed
test(plugin-form): settle the last three entry-row readers
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ
1 parent c9e67b8 commit 9c82809

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎ui/packages/plugin-form/src/MasterDetailForm.totalsCurrency-11132.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async function renderStack(opts: {
111111
</I18nProvider>,
112112
);
113113
// The grid draws no trailing entry row (objectstack#35507): Add the line first.
114-
fireEvent.click(await waitFor(() => screen.getByTestId('line-items-add')));
114+
fireEvent.click(await waitFor(() => screen.getAllByTestId('line-items-add')[0]));
115115
const cell = await waitFor(() => screen.getAllByLabelText('Line Total')[0] as HTMLInputElement);
116116
fireEvent.change(cell, { target: { value: '1234.5' } });
117117
const rate = await waitFor(() => {

‎ui/packages/plugin-form/src/__tests__/lineItemsDeclaredInputs-11536.test.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,12 @@ describe('record:line_items: each of the ten declared keys moves the panel (obje
160160
const adapter = makeAdapter([]);
161161
mount(adapter, node({ parentId: 'p1' }));
162162
// The grid draws no trailing entry row (objectstack#35507): Add the line.
163-
fireEvent.click(await waitFor(() => screen.getByTestId('line-items-add')));
163+
const add = await waitFor(() => {
164+
const el = document.body.querySelector('[data-testid="line-items-add"]') as HTMLButtonElement | null;
165+
if (!el) throw new Error('grid not drawn yet');
166+
return el;
167+
});
168+
fireEvent.click(add);
164169
const ops = await editAndSave(adapter);
165170
expect(ops).toEqual([{ object: 'po_line', action: 'create', data: { label: 'edited', amount: null, po: 'p1' } }]);
166171
});

‎ui/packages/plugin-form/src/createFormGrant-12082.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ describe('MasterDetailForm under a create-only grant on the child (objectui#1208
287287

288288
it('CONTROL — an edit form\'s line cells stay locked under the same grant', async () => {
289289
mountMD('edit');
290-
await waitFor(async () => expect((await cells('Instalment No.')).length).toBeGreaterThan(1));
290+
// The one stored line (the grid draws no trailing entry row, objectstack#35507).
291+
await waitFor(async () => expect((await cells('Instalment No.')).length).toBe(1));
291292
for (const el of [...(await cells('Instalment No.')), ...(await cells('Instalment notes'))]) {
292293
expect(el.disabled).toBe(true);
293294
}

0 commit comments

Comments
 (0)