Skip to content

Commit c1fa2b5

Browse files
committed
test(studio): pin the pair saves' preconditions
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jQpUMdR7QmHKTFR8iB
1 parent 596956d commit c1fa2b5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/InterfacesPillar.customize-28562.test.tsx‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,22 @@ describe('Customize a read-only base’s dashboard into its pair (objectstack#28
356356
expect(srv.saves[1]!.opts.packageId).toBe(PAIR);
357357
});
358358

359+
it('the first save into the pair is pinned to "no draft there", the next to the version it was answered', async () => {
360+
mount();
361+
await openPipeline();
362+
await customize();
363+
364+
patchBoard();
365+
await waitFor(() => expect(srv.saves).toHaveLength(1), { timeout: 8000 });
366+
expect(srv.saves[0]!.opts).toMatchObject({ packageId: PAIR, ifNoneMatch: '*' });
367+
expect(srv.saves[0]!.opts).not.toHaveProperty('ifMatch');
368+
369+
patchBoard();
370+
await waitFor(() => expect(srv.saves).toHaveLength(2), { timeout: 8000 });
371+
expect(srv.saves[1]!.opts).toMatchObject({ packageId: PAIR, ifMatch: 'v1' });
372+
expect(srv.saves[1]!.opts).not.toHaveProperty('ifNoneMatch');
373+
});
374+
359375
it('a second item asks the door again and is answered 200; it is written into the same pair', async () => {
360376
mount();
361377
await openPipeline();
@@ -513,6 +529,8 @@ describe('Customize an object leaf’s list view into the pair (objectstack#2856
513529
expect(saved).toMatchObject({ type: 'view', name: 'opportunity.default', opts: { mode: 'draft', packageId: PAIR } });
514530
expect((saved!.body.config as Record<string, unknown>).calendar).toEqual({ startDateField: 'start_date', titleField: 'name' });
515531
expect(saved!.body.overrides).toEqual({ package: BASE, basedOn: '4.0.0' });
532+
// Read at the base before the pair was there: pinned to "no draft in the pair".
533+
expect(saved!.opts).toMatchObject({ ifNoneMatch: '*' });
516534
expect(srv.base.get('view/opportunity.default')).toStrictEqual(BASE_ROWS['view/opportunity.default']);
517535
await within(header()).findByTestId('studio-override-chip', undefined, { timeout: 8000 });
518536
expect(screen.getByRole('button', { name: t('engine.studio.inspector.listView.addView', 'en') })).toBeDisabled();

0 commit comments

Comments
 (0)