Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Commit 93d4323

Browse files
committed
test: move the default-strip pins off the retired api arm; lint fix (objectui#12325)
The object-gantt / object-grid "parse authors no default" pins rode on the api arm's read.method default, which does not compile against @objectstack/spec main (TS2352). They now ride on navigation's defaults. Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8cff885 commit 93d4323

3 files changed

Lines changed: 21 additions & 12 deletions

File tree

‎packages/plugin-gantt/src/ObjectGantt.discardedReloadIdentity-10036.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ describe("ObjectGantt provider:'value' — the record read survives a discarded
224224
const tree = () => <ObjectGantt schema={schema} />;
225225

226226
const restore = armDiscardProxy();
227-
let mounted = 0;
227+
let mounted: number;
228228
try {
229229
const { rerender } = render(tree());
230230
await waitFor(() => expect(log.length).toBeGreaterThan(0));

‎packages/types/src/__tests__/object-gantt-properties-bag-10859-b6.test.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,23 @@ describe('object-gantt validates in the spec\'s `properties` bag (objectui#10859
245245
expect(safeValidateSchema({ type: 'page', children: [OBJECT_BOUND, BOUND] }).success).toBe(true);
246246
});
247247

248-
it('authors no default into the document: the row\'s `api` `method` default is stripped (objectui#8317)', () => {
248+
// This pin used to ride on the `api` arm's `read.method` default. That arm
249+
// is retired in the spec (objectstack#23082, objectui#12325), so it rides on
250+
// `navigation`, whose spec row writes defaults too.
251+
it('authors no default into the document: the row\'s `navigation` defaults are stripped (objectui#8317)', () => {
249252
const doc = {
250253
type: 'object-gantt',
251-
properties: { data: { provider: 'api', read: { url: '/api/tasks' } }, gantt: GANTT },
254+
properties: { objectName: 'task', navigation: {}, gantt: GANTT },
252255
} as const;
253-
// Control: the spec's own row writes a default `method` into its output.
254-
const specOut = SpecObjectGanttPropsSchema.parse(doc.properties) as { data: { read: Record<string, unknown> } };
255-
expect(specOut.data.read.method).toBe('GET');
256+
// Control: the spec's own row writes a default `mode` into its output.
257+
const specOut = SpecObjectGanttPropsSchema.parse(doc.properties) as unknown as { navigation: Record<string, unknown> };
258+
expect(specOut.navigation.mode).toBe('page');
256259
// This face validates and writes nothing.
257260
const result = safeValidateSchema(doc);
258261
expect(result.success).toBe(true);
259262
if (!result.success) return;
260-
const out = result.data as unknown as { properties: { data: { read: Record<string, unknown> } } };
261-
expect(Object.keys(out.properties.data.read)).toEqual(['url']);
263+
const out = result.data as unknown as { properties: { navigation: Record<string, unknown> } };
264+
expect(Object.keys(out.properties.navigation)).toEqual([]);
262265
});
263266
});
264267

‎packages/types/src/__tests__/object-grid-properties-bag-11276.test.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,18 @@ describe('object-grid validates in the spec\'s `properties` bag (objectui#11276)
282282
}
283283
});
284284

285-
it('the parse authors no default into the document (objectui#8317): an `api` provider keeps no `method`', () => {
286-
const doc = { type: 'object-grid', properties: { objectName: 'task', data: { provider: 'api', read: { url: '/tasks' } } } };
285+
// This pin used to ride on the `api` arm's `read.method` default. That arm
286+
// is retired in the spec (objectstack#23082, objectui#12325), so it rides on
287+
// `navigation`, whose spec row writes defaults too.
288+
it('the parse authors no default into the document (objectui#8317): `navigation` keeps no `mode`', () => {
289+
const doc = { type: 'object-grid', properties: { objectName: 'task', navigation: {} } };
290+
// Control: the spec's own row writes a default `mode` into its output.
291+
const specOut = SpecObjectGridPropsSchema.parse(doc.properties) as unknown as { navigation: Record<string, unknown> };
292+
expect(specOut.navigation.mode).toBe('page');
287293
const parsed = safeValidateSchema(doc);
288294
expect(parsed.success).toBe(true);
289-
const read = (parsed.data as { properties: { data: { read: Record<string, unknown> } } }).properties.data.read;
290-
expect('method' in read).toBe(false);
295+
const navigation = (parsed.data as unknown as { properties: { navigation: Record<string, unknown> } }).properties.navigation;
296+
expect('mode' in navigation).toBe(false);
291297
});
292298
});
293299

0 commit comments

Comments
 (0)