Skip to content

Commit 459475d

Browse files
committed
test(i18nHelpers): sw-2707 replace default prop
1 parent 7e1ff6b commit 459475d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/components/i18n/__tests__/i18nHelpers.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { i18nHelpers, EMPTY_CONTEXT, translate, translateComponent } from '../i18nHelpers';
43

54
describe('I18nHelpers', () => {
@@ -17,14 +16,7 @@ describe('I18nHelpers', () => {
1716
});
1817

1918
it('should attempt to perform a component translate', () => {
20-
const ExampleComponent = ({ t }) => <div>{t('lorem.ipsum', 'hello world')}</div>;
21-
ExampleComponent.propTypes = {
22-
t: PropTypes.func
23-
};
24-
25-
ExampleComponent.defaultProps = {
26-
t: translate
27-
};
19+
const ExampleComponent = ({ t = translate }) => <div>{t('lorem.ipsum', 'hello world')}</div>;
2820

2921
const TranslatedComponent = translateComponent(ExampleComponent);
3022
const component = renderComponent(<TranslatedComponent />);

0 commit comments

Comments
 (0)