huridocs/uwazi

View on GitHub
app/react/Forms/components/specs/__snapshots__/MultiSelect.spec.js.snap

Summary

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

exports[`MultiSelect should display a not found message when there are no options 1`] = `
<ul
  className="multiselect is-active "
>
  <li
    className="multiselectActions"
  >
    <ShowIf
      if={false}
    >
      <div
        className="form-group"
      >
        <Connect(Icon)
          icon="search"
          onClick={[Function]}
        />
        <input
          className="form-control"
          onChange={[Function]}
          placeholder="Search item"
          type="text"
          value=""
        />
      </div>
    </ShowIf>
  </li>
  <span
    className="no-options-message"
  >
    No options found
  </span>
  <li
    className="multiselectActions"
  >
    <ShowIf
      if={false}
    >
      <button
        className="btn btn-xs btn-default"
        onClick={[Function]}
        type="button"
      >
        <Connect(Icon)
          icon="caret-down"
        />
         
        <span>
          -5
           
          <Connect(Translate)>
            x more
          </Connect(Translate)>
        </span>
      </button>
    </ShowIf>
  </li>
</ul>
`;

exports[`MultiSelect should not render aggregations on the groups when not defined 1`] = `
<span
  className="multiselectItem-results"
/>
`;

exports[`MultiSelect should not render an empty group 1`] = `
<ul
  className="multiselect is-active "
>
  <li
    className="multiselectActions"
  >
    <ShowIf
      if={false}
    >
      <div
        className="form-group"
      >
        <Connect(Icon)
          icon="search"
          onClick={[Function]}
        />
        <input
          className="form-control"
          onChange={[Function]}
          placeholder="Search item"
          type="text"
          value=""
        />
      </div>
    </ShowIf>
  </li>
  <li
    className="multiselectItem"
    key="0"
    title="Option1"
  >
    <input
      checked={false}
      className="multiselectItem-input"
      data-state={0}
      disabled={false}
      id="option1"
      onChange={[Function]}
      type="checkbox"
      value="option1"
    />
    <label
      className="multiselectItem-label multiselectItem-option"
      htmlFor="option1"
      onClick={[Function]}
    >
      <span
        className="multiselectItem-icon"
      >
        <Connect(Icon)
          className="checkbox-empty"
          icon={
            Array [
              "far",
              "square",
            ]
          }
        />
        <Connect(Icon)
          className="checkbox-checked"
          icon="check"
        />
        <Connect(Icon)
          className="checkbox-partial"
          icon="minus"
        />
        <Connect(Icon)
          className="checkbox-group"
          icon={
            Array [
              "fas",
              "square",
            ]
          }
        />
        <Connect(Icon)
          className="chevron-right"
          icon="chevron-right"
        />
        <Connect(Icon)
          className="chevron-down"
          icon="chevron-down"
        />
      </span>
      <span
        className="multiselectItem-name"
        onClick={[Function]}
      >
        <Icon
          className="item-icon"
        />
        Option1
      </span>
       
    </label>
    <span
      className="multiselectItem-results"
    >
      <span>
        5
      </span>
    </span>
    <span
      className="multiselectItem-action placeholder"
    />
  </li>
  <li
    className="multiselectItem"
    key="1"
    title="Option2"
  >
    <input
      checked={false}
      className="multiselectItem-input"
      data-state={0}
      disabled={false}
      id="option2"
      onChange={[Function]}
      type="checkbox"
      value="option2"
    />
    <label
      className="multiselectItem-label multiselectItem-option"
      htmlFor="option2"
      onClick={[Function]}
    >
      <span
        className="multiselectItem-icon"
      >
        <Connect(Icon)
          className="checkbox-empty"
          icon={
            Array [
              "far",
              "square",
            ]
          }
        />
        <Connect(Icon)
          className="checkbox-checked"
          icon="check"
        />
        <Connect(Icon)
          className="checkbox-partial"
          icon="minus"
        />
        <Connect(Icon)
          className="checkbox-group"
          icon={
            Array [
              "fas",
              "square",
            ]
          }
        />
        <Connect(Icon)
          className="chevron-right"
          icon="chevron-right"
        />
        <Connect(Icon)
          className="chevron-down"
          icon="chevron-down"
        />
      </span>
      <span
        className="multiselectItem-name"
        onClick={[Function]}
      >
        <Icon
          className="item-icon"
        />
        Option2
      </span>
       
    </label>
    <span
      className="multiselectItem-results"
    >
      <span>
        4
      </span>
    </span>
    <span
      className="multiselectItem-action placeholder"
    />
  </li>
  <li
    aria-label="group"
    className="multiselect-group"
    key="2"
  >
    <div
      className="multiselectItem"
    >
      <input
        checked={false}
        className="group-checkbox multiselectItem-input"
        data-state={0}
        id="undefined"
        onChange={[Function]}
        type="checkbox"
      />
      <label
        className="multiselectItem-label multiselectItem-option"
        htmlFor="Group"
        onClick={[Function]}
      >
        <span
          className="multiselectItem-icon"
        >
          <Connect(Icon)
            className="checkbox-empty"
            icon={
              Array [
                "far",
                "square",
              ]
            }
          />
          <Connect(Icon)
            className="checkbox-checked"
            icon="check"
          />
          <Connect(Icon)
            className="checkbox-partial"
            icon="minus"
          />
          <Connect(Icon)
            className="checkbox-group"
            icon={
              Array [
                "fas",
                "square",
              ]
            }
          />
          <Connect(Icon)
            className="chevron-right"
            icon="chevron-right"
          />
          <Connect(Icon)
            className="chevron-down"
            icon="chevron-down"
          />
        </span>
        <span
          className="multiselectItem-name"
          onClick={[Function]}
        >
          <Icon
            className="item-icon"
          />
          Sub Group
        </span>
         
      </label>
      <span
        className="multiselectItem-results"
      >
        <span>
          3
        </span>
      </span>
      <span
        className="multiselectItem-action"
        onClick={[Function]}
      >
        <Connect(Icon)
          icon="caret-down"
        />
      </span>
    </div>
    <ShowIf
      if={false}
    >
      <ul
        className="multiselectChild is-active"
      >
        <li
          className="multiselectItem"
          key="20"
          title="Group option1"
        >
          <input
            checked={false}
            className="multiselectItem-input"
            data-state={0}
            disabled={false}
            id="group-option1"
            onChange={[Function]}
            type="checkbox"
            value="group-option1"
          />
          <label
            className="multiselectItem-label multiselectItem-option"
            htmlFor="group-option1"
            onClick={[Function]}
          >
            <span
              className="multiselectItem-icon"
            >
              <Connect(Icon)
                className="checkbox-empty"
                icon={
                  Array [
                    "far",
                    "square",
                  ]
                }
              />
              <Connect(Icon)
                className="checkbox-checked"
                icon="check"
              />
              <Connect(Icon)
                className="checkbox-partial"
                icon="minus"
              />
              <Connect(Icon)
                className="checkbox-group"
                icon={
                  Array [
                    "fas",
                    "square",
                  ]
                }
              />
              <Connect(Icon)
                className="chevron-right"
                icon="chevron-right"
              />
              <Connect(Icon)
                className="chevron-down"
                icon="chevron-down"
              />
            </span>
            <span
              className="multiselectItem-name"
              onClick={[Function]}
            >
              <Icon
                className="item-icon"
              />
              Group option1
            </span>
             
          </label>
          <span
            className="multiselectItem-results"
          >
            <span>
              2
            </span>
          </span>
          <span
            className="multiselectItem-action placeholder"
          />
        </li>
        <li
          className="multiselectItem"
          key="21"
          title="Group option2"
        >
          <input
            checked={false}
            className="multiselectItem-input"
            data-state={0}
            disabled={false}
            id="group-option2"
            onChange={[Function]}
            type="checkbox"
            value="group-option2"
          />
          <label
            className="multiselectItem-label multiselectItem-option"
            htmlFor="group-option2"
            onClick={[Function]}
          >
            <span
              className="multiselectItem-icon"
            >
              <Connect(Icon)
                className="checkbox-empty"
                icon={
                  Array [
                    "far",
                    "square",
                  ]
                }
              />
              <Connect(Icon)
                className="checkbox-checked"
                icon="check"
              />
              <Connect(Icon)
                className="checkbox-partial"
                icon="minus"
              />
              <Connect(Icon)
                className="checkbox-group"
                icon={
                  Array [
                    "fas",
                    "square",
                  ]
                }
              />
              <Connect(Icon)
                className="chevron-right"
                icon="chevron-right"
              />
              <Connect(Icon)
                className="chevron-down"
                icon="chevron-down"
              />
            </span>
            <span
              className="multiselectItem-name"
              onClick={[Function]}
            >
              <Icon
                className="item-icon"
              />
              Group option2
            </span>
             
          </label>
          <span
            className="multiselectItem-results"
          >
            <span>
              1
            </span>
          </span>
          <span
            className="multiselectItem-action placeholder"
          />
        </li>
      </ul>
    </ShowIf>
  </li>
  <li
    className="multiselectActions"
  >
    <ShowIf
      if={false}
    >
      <button
        className="btn btn-xs btn-default"
        onClick={[Function]}
        type="button"
      >
        <Connect(Icon)
          icon="caret-down"
        />
         
        <span>
          -2
           
          <Connect(Translate)>
            x more
          </Connect(Translate)>
        </span>
      </button>
    </ShowIf>
  </li>
</ul>
`;