Sha256: 3607a1aa6dfc80110b0cc29e2e625aeb1ad0bc90f96786b98989672492b11d1a
Contents?: true
Size: 860 Bytes
Versions: 56
Compression:
Stored size: 860 Bytes
Contents
import { shallow } from "enzyme"; import * as React from "react"; import * as moment from "moment"; import Application from "./application.component"; const { I18n } = require("react-i18nify"); describe("<Application />", () => { afterEach(() => { I18n.setLocale("en"); }); it("should set I18n locale to locale prop", () => { spyOn(I18n, "setLocale"); const locale = "ca"; shallow( <Application locale={locale}> <div>My application</div> </Application>, ); expect(I18n.setLocale).toHaveBeenCalledWith(locale); }); it("should set moment locale to locale prop", () => { spyOn(moment, "locale"); const locale = "ca"; shallow( <Application locale={locale}> <div>My application</div> </Application>, ); expect(moment.locale).toHaveBeenCalledWith(locale); }); });
Version data entries
56 entries across 56 versions & 2 rubygems