Skip to content

Commit abf0d15

Browse files
committed
test(i18nHelpers): sw-2707 replace default prop
1 parent 20605de commit abf0d15

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

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

Lines changed: 1 addition & 11 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', () => {
@@ -9,22 +8,13 @@ describe('I18nHelpers', () => {
98

109
it('should attempt to perform translate with a node', () => {
1110
const ExampleComponent = () => <div>{translate('lorem.ipsum', { hello: 'world' }, [<span id="test" />])}</div>;
12-
ExampleComponent.propTypes = {};
13-
ExampleComponent.defaultProps = {};
1411

1512
const component = renderComponent(<ExampleComponent />);
1613
expect(component).toMatchSnapshot('translated node');
1714
});
1815

1916
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-
};
17+
const ExampleComponent = ({ t = translate }) => <div>{t('lorem.ipsum', 'hello world')}</div>;
2818

2919
const TranslatedComponent = translateComponent(ExampleComponent);
3020
const component = renderComponent(<TranslatedComponent />);

0 commit comments

Comments
 (0)