Skip to content

Commit 850405c

Browse files
committed
test(ui): pin group placement of a master-detail collection in the entry form
Claude-Session: https://claude.ai/code/session_01L6bhgXUMw7b8gUmNsyoXHR Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3c21300 commit 850405c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎ui/packages/plugin-form/src/MasterDetailForm.groupPlacement-35889.test.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ describe('MasterDetailForm — a group-placed collection sits at its group (obje
6666
if (!el) throw new Error('collection not placed');
6767
});
6868
const placed = await collection(container);
69-
const header = container.querySelector('[data-form-section="header"]')!;
70-
const totals = container.querySelector('[data-form-section="totals"]')!;
69+
const header = container.querySelector('[data-form-section="__section_header"]')!;
70+
const totals = container.querySelector('[data-form-section="__section_totals"]')!;
7171
expect(header).toBeTruthy();
7272
expect(totals).toBeTruthy();
7373
expect(placed.closest('form')).toBe(header.closest('form'));
@@ -82,12 +82,12 @@ describe('MasterDetailForm — a group-placed collection sits at its group (obje
8282
<MasterDetailForm schema={{ objectName: 'po', mode: 'create', details } as any} dataSource={ds} />,
8383
);
8484
await waitFor(() => {
85-
if (!container.querySelector('[data-form-section="totals"]')) throw new Error('header not ready');
85+
if (!container.querySelector('[data-form-section="__section_totals"]')) throw new Error('header not ready');
8686
});
8787
const below = await collection(container);
8888
expect(below.closest('form')).toBeNull();
8989
expect(container.querySelector('[data-form-slot]')).toBeNull();
90-
expect(before(container.querySelector('[data-form-section="totals"]')!, below)).toBe(true);
90+
expect(before(container.querySelector('[data-form-section="__section_totals"]')!, below)).toBe(true);
9191
});
9292

9393
it('a group placed last: after every declared group', async () => {
@@ -99,7 +99,7 @@ describe('MasterDetailForm — a group-placed collection sits at its group (obje
9999
if (!container.querySelector('[data-form-slot] [data-testid="md-collection"]')) throw new Error('not placed');
100100
});
101101
const placed = await collection(container);
102-
expect(before(container.querySelector('[data-form-section="totals"]')!, placed)).toBe(true);
102+
expect(before(container.querySelector('[data-form-section="__section_totals"]')!, placed)).toBe(true);
103103
});
104104

105105
it('saves the record and its lines in one batch from the placed table', async () => {

‎ui/packages/plugin-form/src/formSlots.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('FormSlotStore (objectstack#35889)', () => {
6161
store.subscribe(listener);
6262
expect(store.placement('d0')).toBe('inline');
6363

64-
const el = document.createElement('div');
64+
const el = { tagName: 'DIV' } as unknown as HTMLElement;
6565
store.refFor('d0')(el);
6666
// Mounted but not claimed: still in place.
6767
expect(store.placement('d0')).toBe('inline');

0 commit comments

Comments
 (0)