selection icon indicating copy to clipboard operation
selection copied to clipboard

Added small unit test

Open jopech-tibco opened this issue 1 year ago • 3 comments

Added small unit test for checking that selection is working. This is a POC, but could be really helpful to have UT in place @simonwep

I used @testing-library/dom for simulating mousedown/mousemove/mouseup

How to run?

npx lerna run test --scope @viselect/vanilla

Deps added:

  • vitest
  • playwright
  • @testing-library/dom Screenshot 2024-10-08 at 2 25 43 p m

jopech-tibco avatar Oct 08 '24 20:10 jopech-tibco

Hey @jopech-tibco, that is really cool! Yeah this library is quite "old" and could go with some unit tests, I'll definitely have a look at it the coming days ❤️ Hell, playwright and vitest didn't even exist when I first created it 😅

simonwep avatar Oct 10 '24 16:10 simonwep

Could be quite old, but its really cool and useful

jopech-tibco avatar Oct 10 '24 18:10 jopech-tibco

Alright, I'm gonna keep this PR open for a while until I added a GitHub workflow and maybe a few more tests. I really like this Idea but don't have that much time at hand right now, but thank you for bringing this up. Been using vitest and playwright for years at work but kinda forgot about the projects of my own haha :D

I should probably set up something like prettier as well and migrate ESLint to v9 ugh...

simonwep avatar Oct 13 '24 16:10 simonwep