import { PerformanceReviewSelectionStats } from '../../../../src/api/modules/performanceReviews/business/types/performanceReviewSelectionStats';
import { PerformanceReviewSelectionStatsSC } from '../../../../src/api/modules/performanceReviews/presentation/serializationClasses/performanceReviewSelectionStatsSC';
import { fakePositiveInteger } from '../../../common/common';
import { checkPerformanceReviewReviewerSelectionStatsSerialized } from '../common';

describe('PerformanceReviewSelectionStatsSC', () => {
    let stats: PerformanceReviewSelectionStats;

    beforeEach(() => {
        stats = {
            totalTargetUsers: fakePositiveInteger(),
            totalTargetUsersWithReviewerAssigned: fakePositiveInteger(),
        };
    });

    it('should serialize reviewer selection stats', () => {
        const statsSerialized = new PerformanceReviewSelectionStatsSC().serialize(stats);

        expect(statsSerialized).not.toBeNull();

        checkPerformanceReviewReviewerSelectionStatsSerialized(stats, statsSerialized);
    });
});
