"use strict";

var _createInitialEntries = require("../createInitialEntries");

/* eslint-disable max-lines */
function callTestCase(filename, output) {
  const hashLength = 20;
  const input = (0, _createInitialEntries.createInitialEntriesForManifestJson)(filename, hashLength);
  expect(input).toStrictEqual(output);
}

test('passing empty array', () => {
  const filenames = [];
  const output = {};
  callTestCase(filenames, output);
});
test('check i18n.js files', () => {
  const filename = ['i18n-chunks/en_US/11.939b264d89ba9c22d237.i18n.js'];
  const output = {
    'i18n-chunks/en_US/11.i18n.js': 'i18n-chunks/en_US/11.939b264d89ba9c22d237.i18n.js'
  };
  callTestCase(filename, output);
});
test('check LICENSE.txt file', () => {
  const filename = ['js/store.worker.ce75eef2a576fe0ea685.js.LICENSE.txt'];
  const output = {
    'js/store.worker.js.LICENSE.txt': 'js/store.worker.ce75eef2a576fe0ea685.js.LICENSE.txt'
  };
  callTestCase(filename, output);
});
test('check js file', () => {
  const filename = ['smap/js/efc.659f89ec02c7a454f167.js'];
  const output = {
    'smap/js/efc.js': 'smap/js/efc.659f89ec02c7a454f167.js'
  };
  callTestCase(filename, output);
});
test('check css file', () => {
  const filename = ['css/icons.83848142e71f3f6f06f0.ltr.css'];
  const output = {
    'css/icons.ltr.css': 'css/icons.83848142e71f3f6f06f0.ltr.css'
  };
  callTestCase(filename, output);
});
test('check image file', () => {
  const filename = ['images/radarQrCode.3658d05a928b8337173f.png'];
  const output = {
    'images/radarQrCode.png': 'images/radarQrCode.3658d05a928b8337173f.png'
  };
  callTestCase(filename, output);
});
test('check videos file', () => {
  const filename = ['videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4'];
  const output = {
    'videos/IMBubbleMaximizedView.mp4': 'videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4'
  };
  callTestCase(filename, output);
});
test('check font file', () => {
  const filename = ['fonts/DeskWhiteLogo.9bd41daeeb87d691b83c.svg'];
  const output = {
    'fonts/DeskWhiteLogo.svg': 'fonts/DeskWhiteLogo.9bd41daeeb87d691b83c.svg'
  };
  callTestCase(filename, output);
});
test('check vendor file', () => {
  const filename = ['smap/js/vendor.d8cb6423142255fb107d.js'];
  const output = {
    'smap/js/vendor.js': 'smap/js/vendor.d8cb6423142255fb107d.js'
  };
  callTestCase(filename, output);
});
test('check html file', () => {
  const filename = ['index.7d89d2bdec8567df96ec.html'];
  const output = {
    'index.html': 'index.7d89d2bdec8567df96ec.html'
  };
  callTestCase(filename, output);
}); // eslint-disable-next-line jest/valid-title

test('test an array containing all format of files eg:js, css', () => {
  const filename = ['i18n-chunks/en_US/11.939b264d89ba9c22d237.i18n.js', 'index.7d89d2bdec8567df96ec.html', 'smap/js/vendor.d8cb6423142255fb107d.js', 'fonts/DeskWhiteLogo.9bd41daeeb87d691b83c.svg', 'videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4', 'images/radarQrCode.3658d05a928b8337173f.png', 'css/icons.83848142e71f3f6f06f0.ltr.css', 'smap/js/efc.659f89ec02c7a454f167.js', 'js/store.worker.ce75eef2a576fe0ea685.js.LICENSE.txt'];
  const output = {
    'i18n-chunks/en_US/11.i18n.js': 'i18n-chunks/en_US/11.939b264d89ba9c22d237.i18n.js',
    'index.html': 'index.7d89d2bdec8567df96ec.html',
    'smap/js/vendor.js': 'smap/js/vendor.d8cb6423142255fb107d.js',
    'fonts/DeskWhiteLogo.svg': 'fonts/DeskWhiteLogo.9bd41daeeb87d691b83c.svg',
    'videos/IMBubbleMaximizedView.mp4': 'videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4',
    'images/radarQrCode.png': 'images/radarQrCode.3658d05a928b8337173f.png',
    'css/icons.ltr.css': 'css/icons.83848142e71f3f6f06f0.ltr.css',
    'smap/js/efc.js': 'smap/js/efc.659f89ec02c7a454f167.js',
    'js/store.worker.js.LICENSE.txt': 'js/store.worker.ce75eef2a576fe0ea685.js.LICENSE.txt'
  };
  callTestCase(filename, output);
});