Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

567 B
Raw Blame
import { FEEDBACK_TAGS, feedbackSchema } from './feedback';

describe('feedbackSchema', () => {
  it.each(FEEDBACK_TAGS)('accepts $key with its $direction rating', ({ direction, key }) => {
    expect(feedbackSchema.safeParse({ rating: direction, tag: key }).success).toBe(true);
  });

  it.each(FEEDBACK_TAGS)('rejects $key with the opposite rating', ({ direction, key }) => {
    const oppositeRating = direction === 'thumbsUp' ? 'thumbsDown' : 'thumbsUp';

    expect(feedbackSchema.safeParse({ rating: oppositeRating, tag: key }).success).toBe(false);
  });
});