mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
679 B
31 lines
679 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import moment from 'moment';
|
|
|
|
import { DateHelper } from './date-helper';
|
|
|
|
describe('DateHelper', () => {
|
|
it('should call config method of moment object', () => {
|
|
let called: string;
|
|
|
|
DateHelper.setMoment({
|
|
locale: (l: string) => { called = l; }
|
|
});
|
|
|
|
DateHelper.locale('en');
|
|
|
|
expect(called!).toBe('en');
|
|
});
|
|
|
|
it('should use global moment if not configured', () => {
|
|
DateHelper.setMoment(null);
|
|
DateHelper.locale('en');
|
|
|
|
expect(moment.locale()).toBe('en');
|
|
});
|
|
});
|
|
|