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
4 changes: 2 additions & 2 deletions packages/spec/src/api/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ describe('ExportRequestSchema', () => {
const request = ExportRequestSchema.parse({
object: 'account',
fields: ['name', 'email'],
filters: ['status', '=', 'active'],
where: { status: 'active' },
format: 'xlsx',
});

expect(request.format).toBe('xlsx');
expect(request.filters).toBeDefined();
expect(request.where).toBeDefined();
});
});

Expand Down
10 changes: 5 additions & 5 deletions packages/spec/src/api/endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import {
ApiEndpointSchema,
RateLimitSchema,
ApiMappingSchema,
HttpMethod,
ApiEndpoint,
} from '../system/api.zod';
} from './endpoint.zod';
import { HttpMethod } from './router.zod';

describe('HttpMethod', () => {
it('should accept valid HTTP methods', () => {
const validMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
const validMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'];

validMethods.forEach(method => {
expect(() => HttpMethod.parse(method)).not.toThrow();
});
});

it('should reject invalid HTTP methods', () => {
expect(() => HttpMethod.parse('HEAD')).toThrow();
expect(() => HttpMethod.parse('OPTIONS')).toThrow();
expect(() => HttpMethod.parse('TRACE')).toThrow();
expect(() => HttpMethod.parse('CONNECT')).toThrow();
expect(() => HttpMethod.parse('get')).toThrow();
});
});
Expand Down
10 changes: 8 additions & 2 deletions packages/spec/src/data/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ describe('ObjectCapabilities', () => {
expect(result.searchable).toBe(true);
expect(result.apiEnabled).toBe(true);
expect(result.files).toBe(false);
expect(result.feedEnabled).toBe(false);
expect(result.feeds).toBe(false);
expect(result.activities).toBe(false);
expect(result.trash).toBe(true);
expect(result.mru).toBe(true);
expect(result.clone).toBe(true);
Comment on lines +12 to +16

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete migration: While this test case has been updated to use the new capability fields (feeds, activities, mru, clone), there are other test cases in the same file at lines 217, 308, and 379 that still use the deprecated 'feedEnabled' field. These need to be updated to 'feeds' as well, and should include the new capability fields to ensure complete test coverage. The schema no longer accepts 'feedEnabled' (see object.zod.ts line 45), so those tests would fail.

Copilot uses AI. Check for mistakes.
});

it('should accept custom capability values', () => {
Expand All @@ -19,8 +22,11 @@ describe('ObjectCapabilities', () => {
searchable: false,
apiEnabled: true,
files: true,
feedEnabled: true,
feeds: true,
activities: false,
trash: false,
mru: true,
clone: true,
};

const result = ObjectCapabilities.parse(capabilities);
Expand Down
Loading