import { patchViewImages } from '../Modifiers';

describe('Reducers/Configurator/Modifiers', () => {
    test('patchViewImages fixes the identifiers in the configuration.visualizationData.viewImages object', () => {
        const configuration = {
            visualizationData: {
                viewImages: {
                    '01_front_view': ['path/to/01_front_view/img1.png'],
                    '02_side_view': ['path/to/02_side_view/img1.png'],
                    '03_rear_view': ['path/to/03_rear_view/img1.png'],
                },
            },
        };
        const expectedResult = {
            visualizationData: {
                viewImages: {
                    front_view: ['path/to/01_front_view/img1.png'],
                    side_view: ['path/to/02_side_view/img1.png'],
                    rear_view: ['path/to/03_rear_view/img1.png'],
                },
            },
        };
        expect(patchViewImages(configuration)).toEqual(expectedResult);
    });
});
