Skip to content

Commit

Permalink
fix partial test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Dec 14, 2021
1 parent 0463ee6 commit fda8acf
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* eslint no-console: 0 */
import mockConsole from 'jest-mock-console';
import { configure, resetTranslation, t, tn } from '../../src';
import { configure, resetTranslation, t, tn } from '@superset-ui/core';
import Translator from '../../src/translation/Translator';

import languagePackEn from './languagePacks/en';
Expand Down Expand Up @@ -71,4 +71,16 @@ describe('TranslatorSingleton', () => {
});
});
});
it('should be reset translation setting', () => {
configure();
expect(t('second')).toEqual('second');

resetTranslation();
const restoreConsole = mockConsole();
expect(t('second')).toEqual('second');
resetTranslation();
expect(t('second')).toEqual('second');
expect(console.warn).toBeCalledTimes(2);
restoreConsole();
});
});

0 comments on commit fda8acf

Please sign in to comment.