lion/packages/calendar/test/utils/isSameDate.test.js
Mikhail Bashkirov 9fc5488175 feat(calendar): add reusable calendar
Co-authored-by: Erik Kroes <erik.kroes@ing.com>
Co-authored-by: Gerjan van Geest <gerjan.van.geest@ing.com>
Co-authored-by: Thijs Louisse <thijs.louisse@ing.com>
Co-authored-by: Thomas Allmer <thomas.allmer@ing.com>
2019-05-13 17:46:00 +02:00

19 lines
683 B
JavaScript

import { expect } from '@open-wc/testing';
import { isSameDate } from '../../src/utils/isSameDate.js';
describe('isSameDate', () => {
it('returns true if the same date is given', () => {
const day1 = new Date('2001/01/01');
const day2 = new Date('2001/01/01');
const day3 = new Date('2002/02/02');
expect(isSameDate(day1, day2)).to.be.true;
expect(isSameDate(day1, day3)).to.be.false;
});
it('returns false if not a date is provided', () => {
const day = new Date('2001/01/01');
expect(isSameDate(day, undefined)).to.be.false;
expect(isSameDate(undefined, day)).to.be.false;
expect(isSameDate(undefined, undefined)).to.be.false;
});
});