File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import { act , renderHook } from '@testing-library/react-hooks' ;
22import { useI18nBundle } from './useI18nBundle' ;
3- import { setLanguage } from '@ui5/webcomponents-base/dist/config/Language.js' ;
3+ import { setLanguage , setFetchDefaultLanguage } from '@ui5/webcomponents-base/dist/config/Language.js' ;
44import { version as reactVersion } from 'react/package.json' ;
55import { fetchI18nBundle } from '@ui5/webcomponents-base/dist/i18nBundle' ;
66
77describe ( 'useI18nBundle' , ( ) => {
8+ beforeAll ( ( ) => {
9+ setFetchDefaultLanguage ( true ) ;
10+ } ) ;
11+
12+ afterAll ( ( ) => {
13+ setFetchDefaultLanguage ( false ) ;
14+ } ) ;
15+
816 test ( 'Should load message bundle and update' , async ( ) => {
917 if ( reactVersion === '16.8.0' ) {
1018 // not testable with 16.8.0
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const useI18nBundle = (bundleName: string): I18nBundle => {
1515
1616 useIsomorphicLayoutEffect ( ( ) => {
1717 let isMounted = true ;
18- const i18nBundleData = getI18nBundleData ( '@ui5/webcomponents-react' ) ;
18+ const i18nBundleData = getI18nBundleData ( bundleName ) ;
1919 if ( ! i18nBundleData ) {
2020 fetchI18nBundle ( `${ bundleName } ` ) . then ( ( ) => {
2121 if ( isMounted ) {
You can’t perform that action at this time.
0 commit comments