Files
extension/__mocks__/react-i18next.ts
T
Thibaut Sardan b89064746e Add tests for External import flow (#611)
* with wrong address

* fix address

* cleanup

* isolate address component tests

* using dontMock

* overkill

* without generic __mocks__

* with fake onScan call

* Mock react-i18next to prevent warning in tests (#615)

* mock react-i18next

* revert small change
2021-01-11 10:37:57 +01:00

25 lines
685 B
TypeScript

// Copyright 2019-2021 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
interface useTranslationReturnObj {
i18n: { changeLanguage: () => Promise<unknown>; };
t: (str: string) => string;
}
export const useTranslation = (): useTranslationReturnObj => {
return {
i18n: {
changeLanguage: () => new Promise(() => { /**/ })
},
t: (str: string) => str
};
};
export const withTranslation = () => (component: React.ReactElement): React.ReactElement => component;
export const Trans = ({ children }: { children: React.ReactElement }): React.ReactElement => children;
export default withTranslation;