"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var Cookie = _interopRequireWildcard(require("js-cookie"));

var _stepDefaults = require("./stepDefaults");

describe('stepDefaults', function () {
  beforeEach(function () {
    Cookie.remove('readme_language');
  });
  it('should build a language selection using user cookie', function () {
    Cookie.set('readme_language', 'c');
    var defLang = (0, _stepDefaults.defaultLanguage)();
    expect(defLang).toStrictEqual({
      code: '',
      language: 'c',
      highlightedSyntax: 'text/x-csrc',
      name: 'C'
    });
  });
  it('should return a default if incorrect cookie set', function () {
    Cookie.set('readme_language', 'asdasdf');
    var defLang = (0, _stepDefaults.defaultLanguage)();
    expect(defLang).toStrictEqual({
      code: '',
      language: 'c',
      highlightedSyntax: 'text/x-csrc',
      name: 'C'
    });
  });
  it('should return a default if no cookie exists', function () {
    var defLang = (0, _stepDefaults.defaultLanguage)();
    expect(defLang).toStrictEqual({
      code: '',
      language: 'c',
      highlightedSyntax: 'text/x-csrc',
      name: 'C'
    });
  });
});