Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Conversation

@David-Pena
Copy link
Collaborator

Closes #125

Screenshot 2025-01-22 175202

@David-Pena David-Pena added the enhancement New feature or request label Jan 23, 2025
@David-Pena David-Pena self-assigned this Jan 23, 2025
@David-Pena David-Pena added the question Further information is requested label Jan 23, 2025
@David-Pena
Copy link
Collaborator Author

I'm having trouble with running the tests
Screenshot 2025-01-22 175035

Reading the logs I see the issue is related to embla-carousel, but as we are copying the components from Nuxt UI, It shouldn't require much changes I think.... Maybe you @Barbapapazes see something I don't 🤔

Copy link
Contributor

@Barbapapazes Barbapapazes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look to see why tests are failing.

Do they fail locally?

And you should add a demo.vue for the documentation!

@David-Pena
Copy link
Collaborator Author

Do they fail locally?

Yes

And you should add a demo.vue for the documentation!

My bad, I'll add it soon

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 23, 2025

Deploying vue-ui-playground with  Cloudflare Pages  Cloudflare Pages

Latest commit: 985765d
Status: ✅  Deploy successful!
Preview URL: https://0d684b56.vue-ui-playground.pages.dev
Branch Preview URL: https://david-feature-125-create-car.vue-ui-playground.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 23, 2025

Deploying vue-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 985765d
Status: ✅  Deploy successful!
Preview URL: https://a775aee8.vue-ui.pages.dev
Branch Preview URL: https://david-feature-125-create-car.vue-ui.pages.dev

View logs

@Barbapapazes
Copy link
Contributor

I'm having trouble with running the tests Screenshot 2025-01-22 175035

Reading the logs I see the issue is related to embla-carousel, but as we are copying the components from Nuxt UI, It shouldn't require much changes I think.... Maybe you @Barbapapazes see something I don't 🤔

Hey 👋,

I fix the issue. Actually, we simulate the DOM using jsdom (we could use happy-dom). These tools allow us to quickly run DOM tests without having to load a full browser but they only implement a subset of the DOM API. The issue you was facing was related to this.

After search in the code of embla (https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel/src/components/OptionsHandler.ts#L37), I see that matchMedia was called from the window object and clearly, once you know jsdom has unimplemented features and the relation with window, you know you will have to mock it!

@Barbapapazes Barbapapazes merged commit 51e4d52 into main Feb 3, 2025
2 of 5 checks passed
@Barbapapazes Barbapapazes deleted the david/feature/125-create-carousel-component branch February 3, 2025 09:48
@David-Pena
Copy link
Collaborator Author

Thanks for the fix and explanation @Barbapapazes 🙏🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create the Carousel component

3 participants