<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#
## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->
## Summary
Put together a technique to reuse previews to generate and assert
snapshots.
This either saves time writing snapshot tests or makes snapshot tests
more useful by using them as previews.
This is implemented in a couple of libraries already
([example](https://github.com/BarredEwe/Prefire)). Went with a simple
implementation here but a library can be adopted to leverage additional
features and support.
To hold the code for snapshotting, a new framework was introduced,
SharedTesting, to collect all the utilities built for testing. It must
only be imported in test targets.
The preview side of the code lives in the Shared framework.
Applying this new technique will come in a separate PR.
[Original PR](https://github.com/home-assistant/iOS/pull/3484)
---------
Co-authored-by: Bruno Pantaleão Gonçalves <5808343+bgoncal@users.noreply.github.com>