lion/packages/ui/components/localize/test/date/getDateFormatBasedOnLocale.test.js
2022-10-31 16:55:07 +01:00

16 lines
569 B
JavaScript

import { expect } from '@open-wc/testing';
import { localize, getDateFormatBasedOnLocale } from '@lion/ui/localize.js';
import { localizeTearDown } from '@lion/ui/localize-test-helpers.js';
describe('getDateFormatBasedOnLocale()', () => {
beforeEach(() => {
localizeTearDown();
});
it('returns the positions of day, month and year', async () => {
localize.locale = 'en-GB';
expect(getDateFormatBasedOnLocale()).to.equal('day-month-year');
localize.locale = 'en-US';
expect(getDateFormatBasedOnLocale()).to.equal('month-day-year');
});
});