-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: render with events utility refactoring #554
Conversation
…at/render-with-events
Yes, kind of. We do it this way so we don’t have to migrate all components at once. It reduces the number of changes needed for the upgrade by solely adapting few tests.
Once this PR is merged and rebased into the Svelte v5 branch, only one TODO will remain. |
# Motivation Using the `$on` callback for testing is deprecated in Svelte v5. To align with the changes made in Gix-components (see PR [#544](dfinity/gix-components#554)), we will adopt the `events` option of the `render` function. To facilitate the upgrade and minimize changes in the Svelte v5 PR, we have refactored the test to utilize a utility function. # Changes - Extend `render` utility to support events - Replace all occurences of the keywords `$on()` with the usage of the utilitity # Summarized ``` component.$on("something", something) // => render(Component, {events: {something}} ``` --------- Signed-off-by: David Dal Busco <[email protected]>
# Motivation Using the `$on` callback for testing is deprecated in Svelte v5. To align with the changes made in Gix-components (see PR [#544](dfinity/gix-components#554)), we will adopt the `events` option of the `render` function. To facilitate the upgrade and minimize changes in the Svelte v5 PR, we have refactored the test to utilize a utility function. # Changes - Extend `render` utility to support events - Replace all occurences of the keywords `$on()` with the usage of the utilitity # Summarized ``` component.$on("something", something) // => render(Component, {events: {something}} ``` --------- Signed-off-by: David Dal Busco <[email protected]>
Motivation
Using an
$on
callback for testing is deprecated in Svelte v5 (PR #548). Instead, we will now use theevents
option ofrender
, which itself will eventually be replaced by the library. To minimize changes in the Svelte v5 PR, we refactored the test to use a utility function that handles rendering and event binding.Changes
renderWithEvents
utilitiy.