Skip to content
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

Slots testing recipe idea #99

Open
benmccann opened this issue Sep 5, 2021 · 2 comments
Open

Slots testing recipe idea #99

benmccann opened this issue Sep 5, 2021 · 2 comments
Labels
stale Issue or PR haven't be update for a while

Comments

@benmccann
Copy link
Collaborator

benmccann commented Sep 5, 2021

There's a recipe about testing: https://sveltesociety.dev/recipes/testing-and-debugging/unit-testing-svelte-component/

I found another another solution to testing slots here: bahmutov/cypress-svelte-unit-test#251 (comment). I then found one of the Svelte maintainers doing the same thing here: sveltejs/svelte#4296 (comment)

I saw some references to $$slots being private, but that may have only been true in the past because I see it in the docs, so it feels pretty safe to rely on: https://svelte.dev/docs#slots_object

It looks like @kevmodrome originally added this recipe in https://github.com/svelte-society/sveltesociety.dev-legacy/commits/2103aaf7b9e670b7cfb64048664fd2d2d7ac1dd6/src/pages/recipes/testing-and-debugging/authenetication-with-svelte.svx. I haven't done much unit testing of Svelte components, so I'm curious what he thinks about this approach

@kevmodrome
Copy link
Member

I didn't write the recipe (I think @pngwn did, though I don't remember exactly) but I think changing the recipe to use the method that Luke suggested there makes sense.

In general I think the recipes need some tidying up and re-writing.

@MacFJA MacFJA added the stale Issue or PR haven't be update for a while label Oct 10, 2022
@ibrahimqasim
Copy link

I think this needs to be revisited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue or PR haven't be update for a while
Projects
None yet
Development

No branches or pull requests

4 participants