Skip to content

Commit 409496f

Browse files
committed
test(components): declare the pin's two node types instead of widening the schema prop (objectui#11680)
`SchemaRenderer`'s `schema` prop takes declared node types only, so the pin declares `view:calendar` and `view:timeline` in `CustomNodeRegistry`, the way an application declares a type it registers. Claude-Session: https://claude.ai/code/session_01FngvPpdrnhHMdHHq6vwwju Co-authored-by: Claude <noreply@anthropic.com>
1 parent 18b8a39 commit 409496f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎packages/components/src/__tests__/placeholder-lazy-stub-ownership-11680.test.tsx‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,24 @@ import { cleanup, render, within } from '@testing-library/react';
3535
import React from 'react';
3636
import { ComponentRegistry } from '@object-ui/core';
3737
import { SchemaRenderer } from '@object-ui/react';
38+
import type { BaseSchema } from '@object-ui/types';
3839
import { PlaceholderRenderer, registerPlaceholders } from '../renderers/placeholders';
3940

41+
/**
42+
* The two node types this file's stand-in plugins register, declared to
43+
* `@object-ui/types` the way an application declares a type it registers
44+
* (objectui#11466): `SchemaRenderer`'s `schema` prop takes declared node types
45+
* only.
46+
*/
47+
declare module '@object-ui/types' {
48+
interface CustomNodeRegistry {
49+
'view:calendar': BaseSchema;
50+
'view:timeline': BaseSchema;
51+
}
52+
}
53+
4054
/** The two protocol keys a console stub declares: [authored key, registered name]. */
41-
const CONTESTED: Array<[authored: string, name: string]> = [
55+
const CONTESTED: Array<[authored: 'view:calendar' | 'view:timeline', name: string]> = [
4256
['view:calendar', 'calendar'],
4357
['view:timeline', 'timeline'],
4458
];

0 commit comments

Comments
 (0)