Skip to content

Test coverage for preview panel #1306

Open
@GuySartorelli

Description

@GuySartorelli

Currently there is test coverage for SiteTree and BaseElement objects in preview panels in the cms and elemental modules respectively, but there's no test coverage for previews in general.

The below list is not necessarily an exhaustive list of useful tests that could be implemented.

Behat tests

  • The preview panel is not present if the object belonging to the current form does not implement CMSPreviewable
  • The preview panel is present but collapsed by default if the object belonging to the current form implements CMSPreviewable but returns an empty value from PreviewURL()
  • The preview panel is present and displays the correct content if the object belonging to the current form implements CMSPreviewable and returns a valid relative URL path from PreviewURL()
  • Unversioned and Versioned objects are tested, including published and unpublished objects, and swapping preview modes
  • Swapping preview sizes
  • For CMS 5 only (assuming ENH Records can be made previewable with an extension #1363 and ENH Records can be made previewable via an extension silverstripe-cms#2779 are merged): The DataObject doesn't need to implement CMSPreviewable so long as it has an Extension that does.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions