huridocs/uwazi

View on GitHub
app/react/SemanticSearch/components/specs/__snapshots__/SemanticSearchResults.spec.js.snap

Summary

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

exports[`SemanticSearchResults should render results in ItemList 1`] = `
<div
  className="row panels-layout"
>
  <HelmetWrapper
    defer={true}
    encodeSpecialCharacters={true}
  >
    <title>
      query - Semantic search results
    </title>
  </HelmetWrapper>
  <main
    className="semantic-search-results-viewer document-viewer with-panel"
  >
    <div>
      <h3>
        <Connect(Translate)>
          Semantic search
        </Connect(Translate)>
        :
         
        <Connect(SearchDescription)
          query={Object {}}
          searchTerm="query"
        />
      </h3>
      <button
        className="btn btn-success edit-semantic-search"
        onClick={[Function]}
        type="button"
      >
        <Connect(Icon)
          icon="pencil-alt"
        />
         
        <Connect(Translate)>
          Edit all documents matching this criteria
        </Connect(Translate)>
      </button>
    </div>
    <div
      className="documents-counter"
    >
      <span
        className="documents-counter-label"
      >
        <b>
          0
        </b>
         
        <Connect(Translate)>
          documents
        </Connect(Translate)>
      </span>
    </div>
    <RowList>
      <Connect(Doc)
        additionalText={
          <div
            className="item-metadata"
          >
            <div
              className="metadata-type-text"
            >
              <div>
                <Connect(Translate)>
                  Sentences above threshold
                </Connect(Translate)>
              </div>
              <div>
                2
                 
                <Connect(Translate)>
                  out of
                </Connect(Translate)>
                 
                 (
                50.00
                %)
              </div>
            </div>
          </div>
        }
        doc={
          Immutable.Map {
            "sharedId": "one",
            "semanticSearch": Immutable.Map {
              "averageScore": 0.6,
              "numRelevant": 2,
              "relevantRate": 0.5,
              "results": Immutable.List [
                Immutable.Map {
                  "score": 0.7,
                },
                Immutable.Map {
                  "score": 0.2,
                },
                Immutable.Map {
                  "score": 0.1,
                },
              ],
            },
          }
        }
        key="one"
        onClick={[Function]}
      />
      <Connect(Doc)
        additionalText={
          <div
            className="item-metadata"
          >
            <div
              className="metadata-type-text"
            >
              <div>
                <Connect(Translate)>
                  Sentences above threshold
                </Connect(Translate)>
              </div>
              <div>
                1
                 
                <Connect(Translate)>
                  out of
                </Connect(Translate)>
                 
                 (
                40.00
                %)
              </div>
            </div>
          </div>
        }
        doc={
          Immutable.Map {
            "sharedId": "two",
            "semanticSearch": Immutable.Map {
              "averageScore": 0.4,
              "numRelevant": 1,
              "relevantRate": 0.4,
              "results": Immutable.List [
                Immutable.Map {
                  "score": 0.6,
                },
                Immutable.Map {
                  "score": 0.5,
                },
                Immutable.Map {
                  "score": 0.2,
                },
              ],
            },
          }
        }
        key="two"
        onClick={[Function]}
      />
    </RowList>
    <p
      className="col-sm-12 text-center documents-counter"
    >
      <b>
         
        2
         
      </b>
       
      <Connect(Translate)>
        of
      </Connect(Translate)>
      <b>
         
        0
         
      </b>
       
      <Connect(Translate)>
        documents
      </Connect(Translate)>
    </p>
    <div
      className="col-sm-12 text-center documents-counter"
    >
      <button
        className="btn btn-default btn-load-more"
        onClick={[Function]}
        type="button"
      >
        <span
          no-translate={true}
        >
          30
        </span>
         
        <Connect(Translate)>
          x more
        </Connect(Translate)>
      </button>
    </div>
  </main>
  <Connect(ResultsSidePanel) />
  <Connect(SemanticSearchMultieditPanel)
    formKey="semanticSearch.multipleEdit"
    searchId="id"
  />
</div>
`;

exports[`SemanticSearchResults when the search is empty should render not found page 1`] = `
<div
  className="row panels-layout"
>
  <p>
    <Connect(Translate)>
      Search not found
    </Connect(Translate)>
  </p>
  <HelmetWrapper
    defer={true}
    encodeSpecialCharacters={true}
  >
    <title>
      Search not found
    </title>
  </HelmetWrapper>
</div>
`;