'use strict';

import uniq from 'lodash/uniq';
import { createTextPlaceholder, generateImageId } from '../Modifiers';

describe('Reducers/ImageGallery/Modifiers', () => {
    test('createTextPlaceholder returns the correct result', () => {
        expect(createTextPlaceholder('fakeText')).toEqual('<span data-placeholder="true">fakeText</span>');
    });

    test('generateImageId returns a unique id', () => {
        const results = [];
        const resultCount = 10;

        for (let i = 0; i < resultCount; i++) {
            results.push(generateImageId());
        }

        expect(uniq(results).length).toEqual(resultCount);
    });
});
