Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliaksandr Yankouski committed Jul 13, 2018
1 parent 077d866 commit 04e7859
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
5 changes: 1 addition & 4 deletions packages/kbn-i18n/src/core/helper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ describe('I18n helper', () => {
});

test('should filter unique values only by reference', () => {
expect(unique([{ foo: 'bar' }, { foo: 'bar' }])).toEqual([
{ foo: 'bar' },
{ foo: 'bar' },
]);
expect(unique([{ foo: 'bar' }, { foo: 'bar' }])).toEqual([{ foo: 'bar' }, { foo: 'bar' }]);

const value = { foo: 'bar' };

Expand Down
28 changes: 7 additions & 21 deletions packages/kbn-i18n/src/core/i18n.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,8 @@ describe('I18n engine', () => {
}`,
});

expect(i18n.translate('a.b.c', { values: { numPhotos: 0 } })).toBe(
'You have no photos.'
);
expect(i18n.translate('a.b.c', { values: { numPhotos: 1 } })).toBe(
'You have one photo.'
);
expect(i18n.translate('a.b.c', { values: { numPhotos: 0 } })).toBe('You have no photos.');
expect(i18n.translate('a.b.c', { values: { numPhotos: 1 } })).toBe('You have one photo.');
expect(i18n.translate('a.b.c', { values: { numPhotos: 1000 } })).toBe(
'You have 1,000 photos.'
);
Expand Down Expand Up @@ -476,9 +472,7 @@ describe('I18n engine', () => {
});
i18n.setDefaultLocale('en');

expect(i18n.translate('a.b.c', { values: { result: 0.15 } })).toBe(
'Result: 15%'
);
expect(i18n.translate('a.b.c', { values: { result: 0.15 } })).toBe('Result: 15%');

expect(
i18n.translate('d.e.f', {
Expand Down Expand Up @@ -604,23 +598,17 @@ describe('I18n engine', () => {
['d.e.f']: 'Your total is {total, number, eur}',
});

expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe(
'Your total is $1,000.00'
);
expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe('Your total is $1,000.00');

i18n.setFormats({
number: {
eur: { style: 'currency', currency: 'EUR' },
},
});

expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe(
'Your total is $1,000.00'
);
expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe('Your total is $1,000.00');

expect(i18n.translate('d.e.f', { values: { total: 1000 } })).toBe(
'Your total is €1,000.00'
);
expect(i18n.translate('d.e.f', { values: { total: 1000 } })).toBe('Your total is €1,000.00');
});

test('should format default message with a custom format', () => {
Expand Down Expand Up @@ -669,9 +657,7 @@ describe('I18n engine', () => {
});
i18n.setDefaultLocale('en');

expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe(
'Your total is 1,000'
);
expect(i18n.translate('a.b.c', { values: { total: 1000 } })).toBe('Your total is 1,000');

expect(
i18n.translate('d.e.f', {
Expand Down

0 comments on commit 04e7859

Please sign in to comment.