Open
Description
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 fromPreviewURL()
- 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 fromPreviewURL()
- 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 implementCMSPreviewable
so long as it has anExtension
that does.