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

Version Path
decidim-comments-0.8.4 app/frontend/application/application.component.test.tsx
decidim-comments-0.8.3 app/frontend/application/application.component.test.tsx
decidim-comments-0.8.2 app/frontend/application/application.component.test.tsx
decidim-comments-0.8.1 app/frontend/application/application.component.test.tsx
decidim-comments-0.8.0 app/frontend/application/application.component.test.tsx
decidim-comments-0.7.4 app/frontend/application/application.component.test.tsx
decidim-comments-0.7.3 app/frontend/application/application.component.test.tsx
decidim-comments-0.7.2 app/frontend/application/application.component.test.tsx
decidim-comments-0.7.1 app/frontend/application/application.component.test.tsx
decidim-comments-0.7.0 app/frontend/application/application.component.test.tsx
decidim-comments-0.6.8 app/frontend/application/application.component.test.tsx
decidim-0.6.8 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.7 app/frontend/application/application.component.test.tsx
decidim-0.6.7 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.6 app/frontend/application/application.component.test.tsx
decidim-0.6.6 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.5 app/frontend/application/application.component.test.tsx
decidim-0.6.5 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.4 app/frontend/application/application.component.test.tsx
decidim-0.6.4 decidim-comments/app/frontend/application/application.component.test.tsx