ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/spec/toast-list/__snapshots__/toast-list.spec.js.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Toast list tests should render correctly with notifications 1`] = `
<Provider
  store={
    Object {
      "clearActions": [Function],
      "dispatch": [Function],
      "getActions": [Function],
      "getState": [Function],
      "replaceReducer": [Function],
      "subscribe": [Function],
    }
  }
>
  <ToastList>
    <div
      className="toast-notification"
      id="toastnotification"
    >
      <ToastItem
        key="10000000003625"
        toastNotification={
          Object {
            "data": Object {
              "link": "http://localhost:3000/api/notifications/10000000003624",
            },
            "href": "http://localhost:3000/api/notifications/10000000003625",
            "id": "10000000003625",
            "message": "Plan has completed with errors",
            "notificationType": "event",
            "timeStamp": "",
            "type": "error",
            "unread": true,
          }
        }
      >
        <FeatureToggle(ToastNotification)
          caption=""
          key="10000000003625"
          kind="error"
          lowContrast={true}
          onClick={[Function]}
          subtitle="Plan has completed with errors"
          timeout={6000}
          title=""
        >
          <ToastNotification
            caption=""
            hideCloseButton={false}
            iconDescription="closes notification"
            kind="error"
            lowContrast={true}
            notificationType="toast"
            onClick={[Function]}
            onCloseButtonClick={[Function]}
            role="alert"
            subtitle="Plan has completed with errors"
            timeout={6000}
            title=""
          >
            <div
              className="bx--toast-notification bx--toast-notification--low-contrast bx--toast-notification--error"
              kind="error"
              onClick={[Function]}
              role="alert"
            >
              <NotificationIcon
                iconDescription="error icon"
                kind="error"
                notificationType="toast"
              >
                <ForwardRef(ErrorFilled20)
                  className="bx--toast-notification__icon"
                >
                  <Icon
                    className="bx--toast-notification__icon"
                    fill="currentColor"
                    height={20}
                    preserveAspectRatio="xMidYMid meet"
                    viewBox="0 0 20 20"
                    width={20}
                    xmlns="http://www.w3.org/2000/svg"
                  >
                    <svg
                      aria-hidden={true}
                      className="bx--toast-notification__icon"
                      fill="currentColor"
                      focusable="false"
                      height={20}
                      preserveAspectRatio="xMidYMid meet"
                      viewBox="0 0 20 20"
                      width={20}
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"
                      />
                      <path
                        d="M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"
                        data-icon-path="inner-path"
                        opacity="0"
                      />
                      <title>
                        error icon
                      </title>
                    </svg>
                  </Icon>
                </ForwardRef(ErrorFilled20)>
              </NotificationIcon>
              <NotificationTextDetails
                caption=""
                notificationType="toast"
                subtitle="Plan has completed with errors"
                title=""
              >
                <div
                  className="bx--toast-notification__details"
                >
                  <h3
                    className="bx--toast-notification__title"
                  />
                  <div
                    className="bx--toast-notification__subtitle"
                  >
                    Plan has completed with errors
                  </div>
                  <div
                    className="pull-right toast-pf-action"
                  >
                    <Link
                      href="http://localhost:3000/api/notifications/10000000003624"
                    >
                      <a
                        className="bx--link"
                        href="http://localhost:3000/api/notifications/10000000003624"
                        rel={null}
                      >
                        View details
                      </a>
                    </Link>
                  </div>
                  <span />
                </div>
              </NotificationTextDetails>
              <NotificationButton
                ariaLabel="close notification"
                iconDescription="closes notification"
                notificationType="toast"
                onClick={[Function]}
                renderIcon={
                  Object {
                    "$$typeof": Symbol(react.forward_ref),
                    "render": [Function],
                  }
                }
                type="button"
              >
                <button
                  aria-label="closes notification"
                  className="bx--toast-notification__close-button"
                  onClick={[Function]}
                  title="closes notification"
                  type="button"
                >
                  <ForwardRef(Close20)
                    aria-label="close notification"
                    className="bx--toast-notification__close-icon"
                  >
                    <Icon
                      aria-label="close notification"
                      className="bx--toast-notification__close-icon"
                      fill="currentColor"
                      height={20}
                      preserveAspectRatio="xMidYMid meet"
                      viewBox="0 0 32 32"
                      width={20}
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <svg
                        aria-label="close notification"
                        className="bx--toast-notification__close-icon"
                        fill="currentColor"
                        focusable="false"
                        height={20}
                        preserveAspectRatio="xMidYMid meet"
                        role="img"
                        viewBox="0 0 32 32"
                        width={20}
                        xmlns="http://www.w3.org/2000/svg"
                      >
                        <path
                          d="M17.4141 16L24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"
                        />
                      </svg>
                    </Icon>
                  </ForwardRef(Close20)>
                </button>
              </NotificationButton>
            </div>
          </ToastNotification>
        </FeatureToggle(ToastNotification)>
      </ToastItem>
      <ToastItem
        key="10000000003624"
        toastNotification={
          Object {
            "data": Object {
              "link": null,
            },
            "href": "http://localhost:3000/api/notifications/10000000003624",
            "id": "10000000003624",
            "message": "Plan has completed successfully",
            "notificationType": "event",
            "timeStamp": "",
            "type": "success",
            "unread": true,
          }
        }
      >
        <FeatureToggle(ToastNotification)
          caption=""
          key="10000000003624"
          kind="success"
          lowContrast={true}
          onClick={[Function]}
          subtitle="Plan has completed successfully"
          timeout={6000}
          title=""
        >
          <ToastNotification
            caption=""
            hideCloseButton={false}
            iconDescription="closes notification"
            kind="success"
            lowContrast={true}
            notificationType="toast"
            onClick={[Function]}
            onCloseButtonClick={[Function]}
            role="alert"
            subtitle="Plan has completed successfully"
            timeout={6000}
            title=""
          >
            <div
              className="bx--toast-notification bx--toast-notification--low-contrast bx--toast-notification--success"
              kind="success"
              onClick={[Function]}
              role="alert"
            >
              <NotificationIcon
                iconDescription="success icon"
                kind="success"
                notificationType="toast"
              >
                <ForwardRef(CheckmarkFilled20)
                  className="bx--toast-notification__icon"
                >
                  <Icon
                    className="bx--toast-notification__icon"
                    fill="currentColor"
                    height={20}
                    preserveAspectRatio="xMidYMid meet"
                    viewBox="0 0 20 20"
                    width={20}
                    xmlns="http://www.w3.org/2000/svg"
                  >
                    <svg
                      aria-hidden={true}
                      className="bx--toast-notification__icon"
                      fill="currentColor"
                      focusable="false"
                      height={20}
                      preserveAspectRatio="xMidYMid meet"
                      viewBox="0 0 20 20"
                      width={20}
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10,1c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4,9-9S15,1,10,1z M8.7,13.5l-3.2-3.2l1-1l2.2,2.2l4.8-4.8l1,1L8.7,13.5z"
                      />
                      <path
                        d="M8.7,13.5l-3.2-3.2l1-1l2.2,2.2l4.8-4.8l1,1L8.7,13.5z"
                        data-icon-path="inner-path"
                        fill="none"
                        opacity="0"
                      />
                      <title>
                        success icon
                      </title>
                    </svg>
                  </Icon>
                </ForwardRef(CheckmarkFilled20)>
              </NotificationIcon>
              <NotificationTextDetails
                caption=""
                notificationType="toast"
                subtitle="Plan has completed successfully"
                title=""
              >
                <div
                  className="bx--toast-notification__details"
                >
                  <h3
                    className="bx--toast-notification__title"
                  />
                  <div
                    className="bx--toast-notification__subtitle"
                  >
                    Plan has completed successfully
                  </div>
                  <span />
                </div>
              </NotificationTextDetails>
              <NotificationButton
                ariaLabel="close notification"
                iconDescription="closes notification"
                notificationType="toast"
                onClick={[Function]}
                renderIcon={
                  Object {
                    "$$typeof": Symbol(react.forward_ref),
                    "render": [Function],
                  }
                }
                type="button"
              >
                <button
                  aria-label="closes notification"
                  className="bx--toast-notification__close-button"
                  onClick={[Function]}
                  title="closes notification"
                  type="button"
                >
                  <ForwardRef(Close20)
                    aria-label="close notification"
                    className="bx--toast-notification__close-icon"
                  >
                    <Icon
                      aria-label="close notification"
                      className="bx--toast-notification__close-icon"
                      fill="currentColor"
                      height={20}
                      preserveAspectRatio="xMidYMid meet"
                      viewBox="0 0 32 32"
                      width={20}
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <svg
                        aria-label="close notification"
                        className="bx--toast-notification__close-icon"
                        fill="currentColor"
                        focusable="false"
                        height={20}
                        preserveAspectRatio="xMidYMid meet"
                        role="img"
                        viewBox="0 0 32 32"
                        width={20}
                        xmlns="http://www.w3.org/2000/svg"
                      >
                        <path
                          d="M17.4141 16L24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"
                        />
                      </svg>
                    </Icon>
                  </ForwardRef(Close20)>
                </button>
              </NotificationButton>
            </div>
          </ToastNotification>
        </FeatureToggle(ToastNotification)>
      </ToastItem>
    </div>
  </ToastList>
</Provider>
`;