fullcalendar / fullcalendar-react

The official React Component for FullCalendar

Home Page:https://fullcalendar.io/docs/react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

callback functions not executing during tests

arenac opened this issue · comments

Hello,

First of all great work on Fullcalendar project with all improvements and nice features!

Every thing works fine in the UI but we have some problems to coverage the tests in a better way on the unit test level. Because the DOM during test is not receiving updates when some interaction happens, for example when dragging an event to a different resource when using the resource timeline and interaction plugins.

I tried to reproduce in a simple way, based on how I am using the library at Scania, with mocked data in this branch https://github.com/arenac/fullcalendar-react/tree/timeline-interaction-test-issue

I apologize in advanced for introducing Jest and done some dev decencies upgrades, because when it comes to React test it makes the live easier as I am not so familiar with Karma and its ecosystem. (Perhaps could be also an improvement to reconsidered in the future?)

In the code I am reproducing the problem with only one callback function, but issue might be the same with the other ones.

I would appreciate any help also I would be happy to know if I could have a better approach to implement tests in that case. Or if this is a real issue on the library side could you consider some improvements for better testing?

Jest simulates the DOM and does not have the specific positioning and dimension data that is needed by FullCalendar to do drag-n-drop. It's no surprise drag-n-drop isn't working within Jest.