ONEARMY / community-platform

A platform to build useful communities that aim to tackle global problems
https://platform.onearmy.earth
MIT License
1.14k stars 388 forks source link

[test] add tests to validate functionality of ImageGallery component #2633

Closed iSCJT closed 1 year ago

iSCJT commented 1 year ago

ImageGallery.test.tsx needs to be updated to add tests that validate the current functionality of the ImageGallery component.

bagiyal commented 1 year ago

can you assign me this?

balhelhas commented 1 year ago

@bagiyal Are you still up to do this task?

bagiyal commented 1 year ago

yes sure but I need to do discuss some scenario

BeeMargarida commented 1 year ago

Hi! Is this still available to be worked on? I would like to help

AlfonsoGhislieri commented 1 year ago

Yes feel free to go ahead with this @BeeMargarida!

BeeMargarida commented 1 year ago

@AlfonsoGhislieri Thank you, working on it! The most challenging part is testing the lightbox behaviour. Related to that, are you aware that react-image-lightbox is deprecated? Are you planning on migrating to another package?

AlfonsoGhislieri commented 1 year ago

Thanks for looking into this @BeeMargarida, I did not see that we were still using lightbox, thanks for pointing that out. Definitely don't focusing on testing a component using a deprecated package.

This would be a good opportunity to move on and use Photoswipe and react-photoswipe-gallery, unless you have any other suggestions? 🤔

Edit: This should expand the scope of this PR to adopting a newer package

BeeMargarida commented 1 year ago

@AlfonsoGhislieri Yap, sounds good to me 👍. I can work on migrating it, and looks like a good way to also use the unit tests to verify that no functionality was lost.

BeeMargarida commented 1 year ago

Update: I've migrated to photoswipe, just having some troubles with the tests. To test the lightbox behaviour, it's necessary to use canvas with jsdom, since jsdom does not support fetching external resources. However, this also requires some mocking of Image and window methods, so I'm investigating exactly what's necessary to make this work.

onearmy-bot commented 1 year ago

:tada: This issue has been resolved in version 1.104.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: