Commit e37974b3 authored by Fabio Huser's avatar Fabio Huser

Migrate spec/javascripts/locale/ to Jest

Closes gitlab-org/gitlab#194243
parent c901cb74
import { createDateTimeFormat, languageCode } from '~/locale';
import { setLanguage } from '../helpers/locale_helper';
import { setLanguage } from 'helpers/locale_helper';
describe('locale', () => {
afterEach(() => {
setLanguage(null);
});
afterEach(() => setLanguage(null));
describe('languageCode', () => {
it('parses the lang attribute', () => {
......@@ -22,14 +20,12 @@ describe('locale', () => {
});
describe('createDateTimeFormat', () => {
beforeEach(() => {
setLanguage('de');
});
beforeEach(() => setLanguage('en'));
it('creates an instance of Intl.DateTimeFormat', () => {
const dateFormat = createDateTimeFormat({ year: 'numeric', month: 'long', day: 'numeric' });
expect(dateFormat.format(new Date(2015, 6, 3))).toBe('3. Juli 2015');
expect(dateFormat.format(new Date(2015, 6, 3))).toBe('July 3, 2015');
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment