Sha256: fba12b027de35c783a46ca866803540f4feae2a6d66e3dcb163c1f5ec11323f0
Contents?: true
Size: 836 Bytes
Versions: 11
Compression:
Stored size: 836 Bytes
Contents
import { shallow } from 'enzyme'; import { I18n } from 'react-i18nify'; import moment from 'moment'; import Application from './application.component'; describe('<Application />', () => { afterEach(() => { I18n.setLocale('en'); }); it("should set I18n locale to locale prop", () => { sinon.spy(I18n, 'setLocale'); const locale = "ca"; shallow( <Application locale={locale}> <div>My application</div> </Application> ); expect(I18n.setLocale).to.have.been.calledWith(locale); }); it("should set moment locale to locale prop", () => { sinon.spy(moment, 'locale'); const locale = "ca"; shallow( <Application locale={locale}> <div>My application</div> </Application> ); expect(moment.locale).to.have.been.calledWith(locale); }); });
Version data entries
11 entries across 11 versions & 2 rubygems