Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/objectui/guides/data-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions skills/objectui/guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthClient>` 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<AuthClient>` 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<AuthClient> = {
getSession: vi.fn<AuthClient['getSession']>().mockResolvedValue({
user: { id: '1', email: 'alice@example.com', name: 'Alice' },
session: { token: 'abc' },
}),
listOrganizations: vi.fn<AuthClient['listOrganizations']>().mockResolvedValue([]),
};

render(
Expand Down
Loading