How to use @commercetools-frontend/application-shell - 3 common examples

To help you get started, weā€™ve selected a few @commercetools-frontend/application-shell examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / application-templates / starter / src / components / main-view / main-view.spec.js View on Github external
it('the user can click on the link to "one" and the page should show a text with "View one"', async () => {
    const initialRoute = '/my-project/examples-starter';
    const { getByText, history } = renderApp(, {
      permissions: { canViewProducts: true, canManageProducts: true },
      route: initialRoute,
    });
    await waitForElement(() => getByText(/Hello, world/i));

    fireEvent.click(getByText(/Page one/i));

    await waitForElement(() => getByText(/View one/i));

    expect(history.location).toEqual(
      expect.objectContaining({
        pathname: `${initialRoute}/one`,
      })
    );
  });
});
github commercetools / merchant-center-application-kit / playground / src / components / state-machines-list / state-machines-list.spec.js View on Github external
it('the user can click on the state machines to get to the details page', async () => {
    rendered = renderApp({
      sdkMocks: [
        createStateMachinesListSdkMock(),
        createStateMachinesDetailSdkMockForId1(),
      ],
      permissions: {
        canViewDeveloperSettings: true,
        canManageDeveloperSettings: true,
      },
    });
    await waitForElement(() =>
      rendered.getByText(/There are 2 objects in the cache/i)
    );
    fireEvent.click(rendered.getByText('sm-1'));
    await wait(() => {
      expect(rendered.history.location.pathname).toBe(
        '/my-project/state-machines/sm1'
      );
    });
    await waitForElement(() => rendered.getByText(/sm-1/i));
  });
});
github commercetools / merchant-center-application-kit / playground / src / components / state-machines-list / state-machines-list.spec.js View on Github external
const renderApp = (options = {}) => {
  const route = options.route || '/my-project/state-machines';
  return renderAppWithRedux(, {
    route,
    ...options,
  });
};

@commercetools-frontend/application-shell

React component to bootstrap the general MC application logic

MIT
Latest version published 1 day ago

Package Health Score

87 / 100
Full package analysis