Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('', () => {
const locales = {
greeting: 'Hello {price}',
};
const price = 1234.56;
const formattedPrice = '€1,234.56';
const currency = 'EUR';
const lang = 'en-US';
i18n.init({
locales,
lang,
});
describe('Given the component was mounted to the DOM', () => {
let renderedElement;
it('should match snapshot', () => {
renderedElement = mount((
<div>
<span>
</span>
<span>
</span></div>
describe('', () => {
const locales = {
greeting: 'Hello {name}',
};
i18n.init({
locales,
lang: 'en-US',
});
describe('Given the component was mounted to the DOM', () => {
let renderedElement;
it('should match snapshot', () => {
renderedElement = mount((
));
expect(renderedElement).toMatchSnapshot();
});
describe('', () => {
const locales = {
greeting: 'Hello {world}',
};
const lang = 'en-US';
i18n.init({
locales,
lang,
});
describe('Given the component was mounted to the DOM', () => {
let renderedElement;
it('should render', () => {
renderedElement = mount((
<strong>WORLD</strong>
/
describe('i18n ready', () => {
i18n.init({
locales: {},
lang: 'en-US',
});
const pairs = [
[1, '1.00', 2],
[0.1, '0.10', 2],
[1, '1.000', 3],
[1, '1', 0],
];
/**
* Makes a component.
* @param {number} number Number
* @param {number} fractions Decimal points.
* @returns {Object}
describe('', () => {
const locales = {
greeting: 'Hello {date}',
};
const lang = 'en-US';
const timestamp = 123456789000;
const formattedDate = 'Nov 29, 1973';
const format = 'medium';
i18n.init({
locales,
lang,
});
describe('Given the component was mounted to the DOM', () => {
let renderedElement;
it('should match snapshot', () => {
renderedElement = mount((
<div>
<span>
</span>
<span>
</span></div>
* -------------------------------------------------------------------------
*/
import '@shopgate/pwa-common/styles/reset';
import React from 'react';
import { render } from 'react-dom';
import { configureStore } from '@shopgate/pwa-common/store';
import { appWillStart } from '@shopgate/pwa-common/action-creators/app';
import { i18n } from '@shopgate/engage/core';
import smoothscroll from 'smoothscroll-polyfill';
import fetchClientInformation from '@shopgate/pwa-common/actions/client/fetchClientInformation';
import locales from './locale';
import reducers from './pages/reducers';
import subscribers from './pages/subscribers';
import Pages from './pages';
i18n.init({
locales,
lang: process.env.LOCALE,
});
smoothscroll.polyfill();
const store = configureStore(reducers, subscribers);
store.dispatch(appWillStart(`${window.location.pathname}${window.location.search}`));
store.dispatch(fetchClientInformation());
render(, document.getElementById('root'));
describe('', () => {
const locales = {
greeting: 'Guten Tag {name}',
};
const lang = 'de-DE';
i18nHelper.init({
locales,
lang,
});
describe('Given the component was mounted to the DOM', () => {
let renderedElement;
let renderedInstance;
it('should match snapshot', () => {
renderedElement = shallow();
renderedInstance = renderedElement.instance();
expect(renderedElement).toMatchSnapshot();
});
it('should provide access to i18n via context', () => {
const { i18n } = renderedInstance.getChildContext();
expect(i18n).toEqual(renderedInstance.getI18nInstance);
* -------------------------------------------------------------------------
*/
import '@shopgate/pwa-common/styles/reset';
import React from 'react';
import { render } from 'react-dom';
import { configureStore } from '@shopgate/pwa-common/store';
import { appWillStart } from '@shopgate/pwa-common/action-creators/app';
import fetchClientInformation from '@shopgate/pwa-common/actions/client/fetchClientInformation';
import { i18n } from '@shopgate/engage/core';
import smoothscroll from 'smoothscroll-polyfill';
import locales from './locale';
import reducers from './pages/reducers';
import subscribers from './pages/subscribers';
import Pages from './pages';
i18n.init({
locales,
lang: process.env.LOCALE,
});
smoothscroll.polyfill();
const store = configureStore(reducers, subscribers);
store.dispatch(appWillStart(`${window.location.pathname}${window.location.search}`));
store.dispatch(fetchClientInformation());
render(, document.getElementById('root'));