huridocs/uwazi

View on GitHub
app/react/Uploads/components/specs/__snapshots__/ImportPanel.spec.js.snap

Summary

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

exports[`ImportPanel rendering states should render a form 1`] = `
<SidePanel
  className="metadata-sidepanel"
  mode=""
  open={true}
>
  <div
    className="sidepanel-header"
  >
    <button
      className="closeSidepanel close-modal"
      onClick={[Function]}
      type="button"
    >
      <Connect(Icon)
        icon="times"
      />
    </button>
  </div>
  <div>
    <div
      className="alert alert-info"
    >
      <Connect(Icon)
        icon="info-circle"
        size="2x"
      />
      <div
        className="force-ltr"
      >
        <Connect(Translate)>
          Upload a ZIP or CSV file.
        </Connect(Translate)>
         
        <a
          href="https://github.com/huridocs/uwazi/wiki/Import-CSV"
          rel="noopener noreferrer"
          target="_blank"
        >
          <Connect(Translate)>
            Import instructions
          </Connect(Translate)>
        </a>
      </div>
    </div>
    <LocalForm
      id="import"
      initialState={
        Object {
          "template": 234,
        }
      }
      model="local"
      onSubmit={[Function]}
    >
      <div
        className="form-group"
      >
        <ul
          className="search__filter"
        >
          <li>
            <label
              htmlFor="file"
            >
              <Connect(Translate)>
                File
              </Connect(Translate)>
            </label>
          </li>
          <li
            className="wide"
          >
            <DefaultConnectedControlFile
              accept=".zip,.csv"
              id="file"
              model=".file"
            />
          </li>
        </ul>
      </div>
      <div
        className="form-group"
      >
        <ul
          className="search__filter"
        >
          <li>
            <label
              htmlFor="template"
            >
              <Connect(Translate)>
                Template
              </Connect(Translate)>
            </label>
          </li>
          <li
            className="wide"
          >
            <DefaultConnectedControlSelect
              id="template"
              model=".template"
            >
              <option
                key="234"
                value={234}
              >
                superheroes
              </option>
            </DefaultConnectedControlSelect>
          </li>
        </ul>
      </div>
      <div
        className="form-group"
      />
    </LocalForm>
    <div
      className="sidepanel-footer"
    >
      <button
        className="btn btn-primary"
        form="import"
        id="import-csv"
        type="submit"
      >
        <Connect(Icon)
          icon="upload"
        />
        <span
          className="btn-label"
        >
          <Connect(Translate)>
            Import
          </Connect(Translate)>
        </span>
      </button>
    </div>
  </div>
</SidePanel>
`;

exports[`ImportPanel rendering states when the import starts should render an upload progress 1`] = `
<SidePanel
  className="metadata-sidepanel"
  mode=""
  open={true}
>
  <div
    className="sidepanel-header"
  >
    <button
      className="closeSidepanel close-modal"
      onClick={[Function]}
      type="button"
    >
      <Connect(Icon)
        icon="times"
      />
    </button>
  </div>
  <div
    className="alert alert-info"
  >
    <Connect(Icon)
      icon="info-circle"
      size="2x"
    />
    <div
      className="force-ltr"
    >
      <Connect(Translate)>
        Uploading file
      </Connect(Translate)>
       
      23
      %
    </div>
  </div>
</SidePanel>
`;

exports[`ImportPanel rendering states when the upload starts should render an upload progress 1`] = `
<SidePanel
  className="metadata-sidepanel"
  mode=""
  open={true}
>
  <div
    className="sidepanel-header"
  >
    <button
      className="closeSidepanel close-modal"
      onClick={[Function]}
      type="button"
    >
      <Connect(Icon)
        icon="times"
      />
    </button>
  </div>
  <div
    className="alert alert-info"
  >
    <Connect(Icon)
      icon="info-circle"
      size="2x"
    />
    <div
      className="force-ltr"
    >
      <Connect(Translate)>
        Uploading file
      </Connect(Translate)>
       
      23
      %
    </div>
  </div>
</SidePanel>
`;