mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 00:47:57 +00:00
- Enhanced AGENTS.md with clearer project structure and development commands. - Updated CHANGELOG.md to reflect recent fixes and additions. - Improved formatting in CONTRIBUTING.md for better readability. - Adjusted package.json and configuration files for consistent command structure. - Refined README.md and VISION.md for clarity and organization. - Standardized code formatting in various TypeScript files for consistency. These changes aim to enhance documentation clarity and maintainability across the repository.
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
/* @vitest-environment node */
|
|
import { describe, expect, it, vi } from "vitest";
|
|
|
|
vi.mock("@convex-dev/auth/server", () => ({
|
|
getAuthUserId: vi.fn(),
|
|
authTables: {},
|
|
}));
|
|
|
|
import { listPublicPage } from "./skills";
|
|
|
|
type ListArgs = {
|
|
cursor?: string;
|
|
limit?: number;
|
|
sort?: "updated" | "downloads" | "stars" | "installsCurrent" | "installsAllTime" | "trending";
|
|
nonSuspiciousOnly?: boolean;
|
|
};
|
|
|
|
type ListResult = {
|
|
items: unknown[];
|
|
nextCursor: string | null;
|
|
};
|
|
|
|
type WrappedHandler<TArgs, TResult> = {
|
|
_handler: (ctx: unknown, args: TArgs) => Promise<TResult>;
|
|
};
|
|
|
|
const listPublicPageHandler = (listPublicPage as unknown as WrappedHandler<ListArgs, ListResult>)
|
|
._handler;
|
|
|
|
describe("skills.listPublicPage (deprecated stub)", () => {
|
|
it("returns empty results with no DB reads", async () => {
|
|
const ctx = {
|
|
db: {
|
|
query: vi.fn(),
|
|
get: vi.fn(),
|
|
normalizeId: vi.fn(),
|
|
},
|
|
};
|
|
|
|
const result = await listPublicPageHandler(ctx, {
|
|
sort: "updated",
|
|
limit: 10,
|
|
nonSuspiciousOnly: true,
|
|
});
|
|
|
|
expect(result.items).toEqual([]);
|
|
expect(result.nextCursor).toBeNull();
|
|
expect(ctx.db.query).not.toHaveBeenCalled();
|
|
expect(ctx.db.get).not.toHaveBeenCalled();
|
|
});
|
|
});
|