diff --git a/skills/objectui/guides/data-integration.md b/skills/objectui/guides/data-integration.md index 93909b9753..1e188521b8 100644 --- a/skills/objectui/guides/data-integration.md +++ b/skills/objectui/guides/data-integration.md @@ -31,7 +31,7 @@ methods from context for CRUD, and read the ambient scope through ## DataSource interface ⚠️ The fence below is a deliberately SIMPLIFIED teaching copy, kept rather than -replaced by an import: the published `DataSource` has **38** members and the +replaced by an import: `data.ts` lists every published `DataSource` member and the excerpt is what makes this section readable. The real one is `import type { DataSource } from '@object-ui/types';` (source: `packages/types/src/data.ts`) — read it before you rely on any member's exact diff --git a/skills/objectui/guides/testing.md b/skills/objectui/guides/testing.md index 3e47f78f6c..040d76da47 100644 --- a/skills/objectui/guides/testing.md +++ b/skills/objectui/guides/testing.md @@ -190,17 +190,17 @@ function AuthConsumer() { describe('AuthProvider', () => { it('shows loading then authenticated state', async () => { - // `AuthClient` declares ~38 methods and the provider reaches ONE of them on - // this path. Type the literal `Partial` and the stubbed member - // against `AuthClient['getSession']`: the key, the signature and the - // resolved value are then all checked, and the widening happens ONCE, in a - // named place. Casting the double to `any` unchecks all three at once. - // This is the shape `@object-ui/auth`'s own AuthProvider.test.tsx uses. + // Of every method `AuthClient` declares in `packages/auth/src/types.ts`, this path reaches + // `getSession` on mount and `listOrganizations` once a user is set; an empty list ends the + // organization load there. Type the literal `Partial` and each stub against its + // own member (`AuthClient['getSession']`): the key, the signature and the resolved value are + // then all checked, and the widening happens ONCE, in a named place. `any` unchecks all three. const stub: Partial = { getSession: vi.fn().mockResolvedValue({ user: { id: '1', email: 'alice@example.com', name: 'Alice' }, session: { token: 'abc' }, }), + listOrganizations: vi.fn().mockResolvedValue([]), }; render(