import { findCurrentFontItem } from './fontItemUtils';

describe('DesignerSelectionToolbox/fontItemUtils', () => {
    it('findCurrentFontItem finds the custom font', () => {
        const fontList = [
            {
                family: 'TimesNewRoman',
                bold: true,
                italic: true,
                boldItalic: true,
                isDefault: false,
            },
            {
                family: 'TimesNewRoman',
                bold: true,
                italic: true,
                boldItalic: true,
                isDefault: false,
                isCustomFont: true,
                customName: 'MyFont',
            },
        ];
        const matchCriteria = {
            family: 'TimesNewRoman',
            isCustomFont: true,
            customName: 'MyFont',
            bold: true,
        };
        expect(findCurrentFontItem(fontList, matchCriteria)).toBe(fontList[1]);
    });
});
