Commit 18fe0434 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'refactor/spec-javascripts-locale-to-jest' into 'master'

Migrate spec/javascripts/locale/ to Jest

Closes #194243

See merge request gitlab-org/gitlab!26737
parents e20d7531 e37974b3
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