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

describe('UpdatePerformanceReviewTargetUserVC', () => {
    it(`should pass validation if the user sends no summary`, () => {
        const { errors, output } = getValidationClass(
            {
                summary: null,
            },
            UpdatePerformanceReviewTargetUserVC,
        );

        expect(errors).toHaveLength(0);
        expect(output.summary).toBeNull();
    });

    it(`should pass validation if the user sends null summary`, () => {
        const { errors } = getValidationClass(
            {
                summary: null,
            },
            UpdatePerformanceReviewTargetUserVC,
        );

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

    it(`should pass validation if the user sends correct parameters`, () => {
        const { errors } = getValidationClass(
            {
                summary: faker.lorem.sentence(),
            },
            UpdatePerformanceReviewTargetUserVC,
        );

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