"use strict";

var _removeHashFromFileName = require("../removeHashFromFileName");

/* eslint-disable max-lines */
function callRemoveHash(filename, output) {
  const hashLength = 20;
  const input = (0, _removeHashFromFileName.removeHashFromFileName)(filename, hashLength);
  expect(input).toBe(output);
}

test('check i18n file', () => {
  const filename = 'i18n-chunks/pl_PL/9978.1bff2fdb3a2bb05ee845.i18n.js';
  const output = 'i18n-chunks/pl_PL/9978.i18n.js';
  callRemoveHash(filename, output);
});
test('check LICENSE.txt file', () => {
  const filename = 'js/efc.659f89ec02c7a454f167.js.LICENSE.txt';
  const output = 'js/efc.js.LICENSE.txt';
  callRemoveHash(filename, output);
});
test('check js file', () => {
  const filename = 'smap/js/icons.32650912f9d52c500752.js';
  const output = 'smap/js/icons.js';
  callRemoveHash(filename, output);
});
test('check css file', () => {
  const filename = 'css/styles.304e3585c48bc1da0f50.ltr.css';
  const output = 'css/styles.ltr.css';
  callRemoveHash(filename, output);
});
test('check vendor file', () => {
  const filename = 'smap/js/vendor.d8cb6423142255fb107d.js';
  const output = 'smap/js/vendor.js';
  callRemoveHash(filename, output);
});
test('check image file', () => {
  const filename = 'images/radarQrCode.3658d05a928b8337173f.png';
  const output = 'images/radarQrCode.png';
  callRemoveHash(filename, output);
});
test('check fonts file', () => {
  const filename = 'fonts/DeskWhiteLogo.9bd41daeeb87d691b83c.svg';
  const output = 'fonts/DeskWhiteLogo.svg';
  callRemoveHash(filename, output);
});
test('check videos file', () => {
  const filename = 'videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4';
  const output = 'videos/IMBubbleMaximizedView.mp4';
  callRemoveHash(filename, output);
});
test('check html file', () => {
  const filename = 'index.7d89d2bdec8567df96ec.html';
  const output = 'index.html';
  callRemoveHash(filename, output);
});
test('chunk name greater than hash', () => {
  const filename = 'videos/IMBubbleMaximizedView.5d2ab1747e7d1bcd1add.mp4';
  const output = 'videos/IMBubbleMaximizedView.mp4';
  callRemoveHash(filename, output);
});
test('chunk name lesser than hash', () => {
  const filename = 'index.7d89d2bdec8567df96ec.html';
  const output = 'index.html';
  callRemoveHash(filename, output);
});
test('check i18n.js.map file', () => {
  const filename = 'i18n-chunks/pl_PL/9978.1bff2fdb3a2bb05ee845.i18n.js.map';
  const output = 'i18n-chunks/pl_PL/9978.i18n.js.map';
  callRemoveHash(filename, output);
});
test('check LICENSE.txt.map file', () => {
  const filename = 'js/efc.659f89ec02c7a454f167.js.LICENSE.txt.map';
  const output = 'js/efc.js.LICENSE.txt.map';
  callRemoveHash(filename, output);
});
test('check js.map file', () => {
  const filename = 'smap/js/icons.32650912f9d52c500752.js.map';
  const output = 'smap/js/icons.js.map';
  callRemoveHash(filename, output);
});
test('check css.map file', () => {
  const filename = 'css/styles.304e3585c48bc1da0f50.ltr.css.map';
  const output = 'css/styles.ltr.css.map';
  callRemoveHash(filename, output);
});
test('check vendor.js.map file', () => {
  const filename = 'smap/js/vendor.d8cb6423142255fb107d.js.map';
  const output = 'smap/js/vendor.js.map';
  callRemoveHash(filename, output);
});