Ask A Question


You’re not receiving notifications from this thread.

How can I test sortableJs ? (RSpec)

paul lahana asked in Testing

I made a drag and drop to-do-list with SortableJs and i'm trying to test the drag-n-drop with RSpec/Selenium/Capybara if the request is sent onEnd.
I'm able to do the drag n drop using selenium drag_and_drop. My card is dropped in the right column but when i check if the status is persisted it looks like my PlannedAction still has it's previous status..
I tried to page.execute_script('const action_card = document.querySelector(".c-action-card"); action_card.dispatchEvent(new Event("dragend"));') to force the event to be fired and get the stimulus controller to react but still nothing..

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.