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.6.3 app/frontend/application/application.component.test.tsx
decidim-0.6.3 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.2 app/frontend/application/application.component.test.tsx
decidim-0.6.2 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.1 app/frontend/application/application.component.test.tsx
decidim-0.6.1 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.6.0 app/frontend/application/application.component.test.tsx
decidim-0.6.0 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.5.1 app/frontend/application/application.component.test.tsx
decidim-0.5.1 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.5.0 app/frontend/application/application.component.test.tsx
decidim-0.5.0 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.4.4 app/frontend/application/application.component.test.tsx
decidim-0.4.4 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-comments-0.4.3 app/frontend/application/application.component.test.tsx
decidim-comments-0.4.2 app/frontend/application/application.component.test.tsx
decidim-comments-0.4.1 app/frontend/application/application.component.test.tsx
decidim-0.4.3 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-0.4.2 decidim-comments/app/frontend/application/application.component.test.tsx
decidim-0.4.1 decidim-comments/app/frontend/application/application.component.test.tsx