Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transition directive wrapper for test purpose (#573)
# Motivation Svelte requires require the [web animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API), and neither [jsdom](https://github.com/jsdom/jsdom) nor [happy-dom](https://github.com/capricorn86/happy-dom) implements it. While in Gix-cmp or OISY we are able to apply some mocks in the configuration, this is insuffisent for the existing large test suite of NNS dapp for which many tests fail, when migrating to Svelte v5, with the error: > TypeError: Cannot set properties of undefined (setting 'onfinish') As suggested in one of the related issues (see linked below), we can overcome the problem by disabling animations in test mode. # References - testing-library/svelte-testing-library#284 (comment) - testing-library/svelte-testing-library#416 # CI issues - https://github.com/dfinity/nns-dapp/actions/runs/13129931873/job/36632946426 # Changes - Implement utils for fade, fly and scale that returns an empty transition configuration for test mode - Expose utils to make to re-usable by consumers as well # Tests Errors do not happen anymore in NNS dapp - Svelte v5 wip branch running in the CI. - https://github.com/dfinity/nns-dapp/actions/runs/13131104521/job/36636304026?pr=6020 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information