"use strict";

var _addHttp = _interopRequireDefault(require("./addHttp"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('Add HTTP', () => {
  test('Do nothing to correct url', () => {
    const url = 'https://www.google.com';
    expect((0, _addHttp.default)(url)).toBe(url);
  });
  test('Fix wrong urls', () => {
    const urls = ['www.google.com', '//www.google.com', '///www.google.com', 'http://www.google.com', 'http:///www.google.com', 'https://www.google.com', 'https:////www.google.com'];
    let correctUrl = 'https://www.google.com';

    for (let i = 0, len = urls.length; i < len; i += 1) {
      expect((0, _addHttp.default)(urls[i])).toBe(correctUrl);
    }
  });
});