advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
930 stars 128 forks source link

Test support / documentation #275

Open xFeXx opened 2 months ago

xFeXx commented 2 months ago

Hey there, thank you for this neat cropper component! It works really well with vue3 + nuxt3.

Sadly I can't really see any tests and no guide on how to test components using this component. For example the whole methods section is really hard to test without any explanations. https://advanced-cropper.github.io/vue-advanced-cropper/components/cropper.html#methods

I use vitest and atm I got some things testes with spys:

const rotateSpy = vi.spyOn(cropper.vm, 'rotate').mockImplementationOnce(() => vi.fn())

This is not sufficiant for more complex use cases like the things you do in your examples. Especially the getResult() method I can't get to be correctly mocked.

Are there any plans on adding test examples oder some sort of explanation to the project?

Thanks in advance!