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

chore(vue3): add unit test for isSlotPopulated #4516

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

raimund-schluessler
Copy link
Contributor

This adds a unit test for the isSlotPopulated util. This util is made to check whether a slot actually contains content. I also slightly changed it to check whether there is only an empty Text node.

In vue 3 the usual way used in vue 2 does not work anymore.
Both !!this.$slots.default and !!this.$slots.default?.() will basically always be true.

tests/unit/utils/isSlotPopulated.spec.js Outdated Show resolved Hide resolved
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
@raimund-schluessler raimund-schluessler merged commit 830a527 into next Sep 13, 2023
15 checks passed
@raimund-schluessler raimund-schluessler deleted the chore/2154/slot-populated branch September 13, 2023 10:39
@susnux susnux mentioned this pull request Jan 23, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews vue 3 Related to the vue 3 migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants