const chai = require('chai');
const expect = chai.expect;
const scripts = require('../scripts/scripts');

describe('scripts', function() {

  it('normalizeCardInput() should make all characters lowercase, strip colons and replace spaces with a dash', function(){
    let testString = "Ghost Fragment: Legends";
    expect(scripts.normalizeCardInput(testString)).to.equal("ghost-fragment-legends");
  })

  it('normalizeItemInput() should make all characters lowercase, strip semi-colons and replace spaces with a dash', function(){
    let testString = "Saint-14's Ring";
    expect(scripts.normalizeItemInput(testString)).to.equal("saint-14s-ring");
  })

  it('randomQuote() should return a random index from an Object', function() {
    const quotes = require('./TestData/petra');
    const quoteOne = scripts.randomQuote(quotes);
    const quoteTwo = scripts.randomQuote(quotes);
    expect(quoteOne).to.not.equal(quoteTwo);
  })

  it('curDay() should return the current day', function() {
    const date = new Date();
    const CurrentDay = date.getDate();
    const day = scripts.curDay();
    expect(day).to.equal(CurrentDay);
  })

  it('curMonth() should return the current month as a string', function() {
    const date = new Date();
    const TestMonth = date.getMonth();
    const months = [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    ];
    const currentTestMonth = months[TestMonth];
    const scriptMonth = scripts.curMonth();
    expect(currentTestMonth).to.be.a('string');
    expect(scriptMonth).to.equal(currentTestMonth);
  })

})

@@ -18,14 +18,14 @@
 ire(
-'
+%22
 chai
-'
+%22
 );%0Ac
@@ -75,17 +75,17 @@
 require(
-'
+%22
 ../scrip
@@ -94,17 +94,17 @@
 /scripts
-'
+%22
 );%0A%0Adesc
@@ -112,17 +112,17 @@
 ibe(
-'
+%22
 scripts
-'
+%22
 , fu
@@ -132,23 +132,22 @@
 ion() %7B%0A
-%0A
   it(
-'
+%22
 normaliz
@@ -232,33 +232,33 @@
 aces with a dash
-'
+%22
 , function()%7B%0A  
@@ -245,32 +245,33 @@
 ash%22, function()
+ 
 %7B%0A    let testSt
@@ -364,16 +364,23 @@
 o.equal(
+%0A      
 %22ghost-f
@@ -395,31 +395,37 @@
 legends%22
+%0A    
 );%0A  %7D)
+;
 %0A%0A  it(
-'
+%22
 normaliz
@@ -523,17 +523,17 @@
 h a dash
-'
+%22
 , functi
@@ -536,16 +536,17 @@
 nction()
+ 
 %7B%0A    le
@@ -662,24 +662,25 @@
 %22);%0A  %7D)
+;
 %0A%0A  it(
-'
+%22
 randomQu
@@ -728,17 +728,17 @@
 n Object
-'
+%22
 , functi
@@ -771,17 +771,17 @@
 require(
-'
+%22
 ./TestDa
@@ -788,17 +788,17 @@
 ta/petra
-'
+%22
 );%0A    c
@@ -941,24 +941,25 @@
 o);%0A  %7D)
+;
 %0A%0A  it(
-'
+%22
 curDay()
@@ -988,17 +988,17 @@
 rent day
-'
+%22
 , functi
@@ -1152,16 +1152,17 @@
   %7D)
+;
 %0A%0A  it(
-'
+%22
 curM
@@ -1211,17 +1211,17 @@
 a string
-'
+%22
 , functi
@@ -1649,16 +1649,16 @@
 e.a(
-'
+%22
 string
-'
+%22
 );%0A 
@@ -1716,9 +1716,1048 @@
   %7D)
-%0A%0A%7D)
+,%0A    it(%22esMonths() should return the in-game version of the current month as a string%22, function() %7B%0A      const date = new Date();%0A      const TestMonth = date.getMonth();%0A      switch (TestMonth) %7B%0A        case 0:%0A          return %22Morning Star%22;%0A          break;%0A        case 1:%0A          return %22Sun's Dawn%22;%0A          break;%0A        case 2:%0A          return %22First Seed%22;%0A          break;%0A        case 3:%0A          return %22Rain's Hand%22;%0A          break;%0A        case 4:%0A          return %22Second Seed%22;%0A          break;%0A        case 5:%0A          return %22Mid Year%22;%0A          break;%0A        case 6:%0A          return %22Sun's Height%22;%0A          break;%0A        case 7:%0A          return %22Last Seed%22;%0A          break;%0A        case 8:%0A          return %22Hearthfire%22;%0A          break;%0A        case 9:%0A          return %22Frostfall%22;%0A          break;%0A        case 10:%0A          return %22Sun's Dusk%22;%0A          break;%0A        case 11:%0A          return %22Evening Star%22;%0A          break;%0A        default:%0A          %22%22;%0A          break;%0A      %7D%0A    %7D);%0A%7D);
 %0A

add prettier formatting and test for esMonths