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

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

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

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

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

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

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