How to use the @commercetools-frontend/constants.NOTIFICATION_KINDS_PAGE.error function in @commercetools-frontend/constants

To help you get started, we’ve selected a few @commercetools-frontend/constants 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 / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
beforeEach(() => {
      mocked(useSelector).mockClear();
      mocked(useSelector).mockReturnValue([
        {
          id: 1,
          domain: NOTIFICATION_DOMAINS.PAGE,
          kind: NOTIFICATION_KINDS_PAGE.error,
          text: 'Something went wrong',
        },
      ]);
      rendered = renderComponent(
        
          
        
      );
    });
    it('should render the  notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
beforeEach(() => {
        mocked(useSelector).mockClear();
        mocked(useSelector).mockReturnValue([
          {
            id: 1,
            domain: NOTIFICATION_DOMAINS.PAGE,
            kind: NOTIFICATION_KINDS_PAGE.error,
            text: 'Something went wrong',
          },
        ]);
        rendered = renderComponent(
          
        );
      });
      it('should render the GenericNotification notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.tsx View on Github external
notification
        );
        if (CustomNotificationComponent) {
          return (
             {
                dispatch(removeNotification(notification.id));
              }}
            />
          );
        }

        switch (notification.kind) {
          case NOTIFICATION_KINDS_PAGE.error:
          case NOTIFICATION_KINDS_PAGE.warning:
          case NOTIFICATION_KINDS_PAGE.info:
          case NOTIFICATION_KINDS_PAGE.success: {
            const { values, ...genericNotification } = notification;
            return (
               {
                  dispatch(removeNotification(notification.id));
                }}
              />
            );

@commercetools-frontend/constants

Shared constants for MC applications

MIT
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis