const isLogoValid = require("../is_logo_valid");
var logo = {startMonth: 0, startDay: 0, endMonth: 0, endDay: 0};
Date.now = jest.fn(() => new Date(2019,10,12));

test("no start day, start month, end day, or end month is provided", () => {
    expect(isLogoValid(logo)).toBeTruthy();
});

test("The end date is after the start date and the current date is between the start date and the end date", () => {
    logo.endMonth = 12;
    expect(isLogoValid(logo)).toBeTruthy();
});
test("the end date is after the start date and the current date is before the start date"
, () => {
    logo.startMonth = 12;
    logo.endMonth = 1;
    expect(isLogoValid(logo)).toBeFalsy();
});
test("the end date is after the start date and the current date is after the end date"
, () => {
    logo.startMonth = 7;
    logo.endMonth = 10;
    expect(isLogoValid(logo)).toBeFalsy();
});
test("the end date is before the start date and the current date is before the start date"
, () => {
    logo.startMonth = 12;
    logo.startDay = 1;
    logo.endMonth = 3;
    logo.endDay = 1;
    expect(isLogoValid(logo)).toBeFalsy();
});
test("the end date is before the start date and the current date is between the start date and the next end date"
, () => {
    Date.now = jest.fn(() => new Date(2020,0,1));
    logo.startMonth = 12;
    logo.startDay = 1;
    logo.endMonth = 3;
    logo.endDay = 1;
    expect(isLogoValid(logo)).toBeTruthy();
});
test("the end date is before the start date and the current date is between the start date and the next end date"
, () => {
    Date.now = jest.fn(() => new Date(2020,0,1));
    logo.startMonth = 2;
    logo.startDay = 5;
    logo.endMonth = 1;
    logo.endDay = 5;
    expect(isLogoValid(logo)).toBeTruthy();
});
test("the end date is before the start date and the current date is between the start date and the next end date"
, () => {
    Date.now = jest.fn(() => new Date(2020,0,10));
    logo.startMonth = 2;
    logo.startDay = 5;
    logo.endMonth = 1;
    logo.endDay = 5;
    expect(isLogoValid(logo)).toBeFalsy();
});