lion/packages/calendar/test/utils/getLastDayPreviousMonth.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

11 lines
611 B
JavaScript

import { expect } from '@open-wc/testing';
import { formatDate } from '../../../localize/src/date/formatDate.js';
import { getLastDayPreviousMonth } from '../../src/utils/getLastDayPreviousMonth.js';
describe('getLastDayPreviousMonth', () => {
it('returns the last day of the previous month', () => {
expect(formatDate(getLastDayPreviousMonth(new Date('2001/01/01')))).to.be.equal('31/12/2000');
expect(formatDate(getLastDayPreviousMonth(new Date('2001/10/10')))).to.be.equal('30/09/2001');
expect(formatDate(getLastDayPreviousMonth(new Date('2000/03/10')))).to.be.equal('29/02/2000');
});
});