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

Version Path
decidim-comments-0.0.6 app/frontend/application/application.component.test.jsx
decidim-0.0.6 decidim-comments/app/frontend/application/application.component.test.jsx
decidim-comments-0.0.5 app/frontend/application/application.component.test.jsx
decidim-0.0.5 decidim-comments/app/frontend/application/application.component.test.jsx
decidim-0.0.4 decidim-comments/app/frontend/application/application.component.test.jsx
decidim-comments-0.0.3 app/frontend/application/application.component.test.jsx
decidim-0.0.3 decidim-comments/app/frontend/application/application.component.test.jsx
decidim-comments-0.0.2 app/frontend/application/application.component.test.jsx
decidim-0.0.2 decidim-comments/app/frontend/application/application.component.test.jsx
decidim-comments-0.0.1 app/frontend/application/application.component.test.jsx
decidim-0.0.1 decidim-comments/app/frontend/application/application.component.test.jsx