import { faker } from '@faker-js/faker/locale/en_US';
import { ListPerformanceReviewCycleVC } from '../../../../src/api/modules/performanceReviews/presentation/validationClasses/listPerformanceReviewCycleVC';
import { getValidationClass } from '../../../common/serializationClasses/serializationClassesHelper';

describe('ListPerformanceReviewCycleVC', () => {
    it('should pass validation if the user sends an empty object', () => {
        const { errors } = getValidationClass({}, ListPerformanceReviewCycleVC);

        expect(errors).toHaveLength(0);
    });

    it('should pass validation if the user sends correct q', () => {
        const { errors } = getValidationClass(
            {
                q: faker.word.words(),
            },
            ListPerformanceReviewCycleVC,
        );

        expect(errors).toHaveLength(0);
    });

    it('should validate correctly if the user sends incorrect q', () => {
        const { errors } = getValidationClass(
            {
                q: faker.datatype.boolean(),
            },
            ListPerformanceReviewCycleVC,
        );

        expect(errors).toPartiallyContain({ property: 'q' });
    });
});
