fix: 移除项目探索标签数量上限
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { AIEventInputSchema } from './validations';
|
||||
import { AIEventInputSchema, ProjectInputSchema } from './validations';
|
||||
|
||||
describe('AIEventInputSchema', () => {
|
||||
const validEvent = {
|
||||
@@ -62,3 +62,34 @@ describe('AIEventInputSchema', () => {
|
||||
})).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ProjectInputSchema', () => {
|
||||
const baseProjectInput = {
|
||||
name: 'Agent Park',
|
||||
description: 'A curated list of practical AI agent tools.',
|
||||
tags: [{ name: 'ai-agent' }],
|
||||
links: [{ type: 'GITHUB' as const, url: 'https://github.com/example/repo' }],
|
||||
};
|
||||
|
||||
it('should allow more than 10 tags', () => {
|
||||
const manyTags = Array.from({ length: 20 }, (_, index) => ({
|
||||
name: `tag-${index + 1}`,
|
||||
}));
|
||||
|
||||
expect(() =>
|
||||
ProjectInputSchema.parse({
|
||||
...baseProjectInput,
|
||||
tags: manyTags,
|
||||
})
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('should still require at least one tag', () => {
|
||||
expect(() =>
|
||||
ProjectInputSchema.parse({
|
||||
...baseProjectInput,
|
||||
tags: [],
|
||||
})
|
||||
).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user