huridocs/uwazi

View on GitHub
app/react/Templates/components/specs/__snapshots__/PropertyConfigOptions.spec.js.snap

Summary

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

exports[`PropertyConfigOptions Additional options should allow to exclude the "use as filter" option 1`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions Once the property is checked as filter should render the default filter option 1`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Default filter"
      model="template.data.properties[2].defaultfilter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as default filter description"
        >
          Use this property as a default filter in the library. When there are no entity types selected, this property will show as a default filter for your collection.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Priority sorting"
      model="template.data.properties[2].prioritySorting"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Priority sorting description"
        >
          Properties marked as priority sorting will be used as default sorting criteria. If more than one property is marked as priority sorting the system will try to pick-up the best fit. When listing mixed template types, the system will pick-up the best combined priority sorting.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is not true should not render priority sorting option 1`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is not true should not render priority sorting option 2`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is not true should not render priority sorting option 3`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is not true should not render priority sorting option 4`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is true should render for text, date, numeric and select if property filter is true 1`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Default filter"
      model="template.data.properties[2].defaultfilter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as default filter description"
        >
          Use this property as a default filter in the library. When there are no entity types selected, this property will show as a default filter for your collection.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Priority sorting"
      model="template.data.properties[2].prioritySorting"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Priority sorting description"
        >
          Properties marked as priority sorting will be used as default sorting criteria. If more than one property is marked as priority sorting the system will try to pick-up the best fit. When listing mixed template types, the system will pick-up the best combined priority sorting.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is true should render for text, date, numeric and select if property filter is true 2`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Default filter"
      model="template.data.properties[2].defaultfilter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as default filter description"
        >
          Use this property as a default filter in the library. When there are no entity types selected, this property will show as a default filter for your collection.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Priority sorting"
      model="template.data.properties[2].prioritySorting"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Priority sorting description"
        >
          Properties marked as priority sorting will be used as default sorting criteria. If more than one property is marked as priority sorting the system will try to pick-up the best fit. When listing mixed template types, the system will pick-up the best combined priority sorting.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is true should render for text, date, numeric and select if property filter is true 3`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Default filter"
      model="template.data.properties[2].defaultfilter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as default filter description"
        >
          Use this property as a default filter in the library. When there are no entity types selected, this property will show as a default filter for your collection.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Priority sorting"
      model="template.data.properties[2].prioritySorting"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Priority sorting description"
        >
          Properties marked as priority sorting will be used as default sorting criteria. If more than one property is marked as priority sorting the system will try to pick-up the best fit. When listing mixed template types, the system will pick-up the best combined priority sorting.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions priority sorting option when property filter is true should render for text, date, numeric and select if property filter is true 4`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Default filter"
      model="template.data.properties[2].defaultfilter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as default filter description"
        >
          Use this property as a default filter in the library. When there are no entity types selected, this property will show as a default filter for your collection.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
    <PropertyConfigOption
      label="Priority sorting"
      model="template.data.properties[2].prioritySorting"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Priority sorting description"
        >
          Properties marked as priority sorting will be used as default sorting criteria. If more than one property is marked as priority sorting the system will try to pick-up the best fit. When listing mixed template types, the system will pick-up the best combined priority sorting.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;

exports[`PropertyConfigOptions should render fields with the correct datas 1`] = `
<div>
  <PropertyConfigOption
    label="Hide label"
    model="template.data.properties[2].noLabel"
  >
    <Tip>
      <Connect(Translate)>
        This property will be shown without the label.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Required property"
    model="template.data.properties[2].required"
  >
    <Tip>
      <Connect(Translate)
        translationKey="empty property tip"
      >
        You won't be able to save an entity if this property is empty.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <PropertyConfigOption
    label="Show in cards"
    model="template.data.properties[2].showInCard"
  >
    <Tip>
      <Connect(Translate)>
        This property will appear in the library cards as part of the basic info.
      </Connect(Translate)>
    </Tip>
  </PropertyConfigOption>
  <div
    className="inline-group"
  >
    <PropertyConfigOption
      label="Use as filter"
      model="template.data.properties[2].filter"
    >
      <Tip>
        <Connect(Translate)
          translationKey="Property as filter description"
        >
          This property will be used for filtering the library results. When properties match in equal name and field type with other entity types, they will be combined for filtering.
        </Connect(Translate)>
      </Tip>
    </PropertyConfigOption>
  </div>
  <Connect(SharedProperties)
    index={2}
  />
</div>
`;