X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/361dcbb1dfd05c09034ed92da9bbf4305fcb8da9..f5a573ab4aab064db68853dede1fc8bfa370ddec:/test/system/directions_test.rb?ds=inline diff --git a/test/system/directions_test.rb b/test/system/directions_test.rb index 08f5cb8e3..91a033c4d 100644 --- a/test/system/directions_test.rb +++ b/test/system/directions_test.rb @@ -37,7 +37,7 @@ class DirectionsSystemTest < ApplicationSystemTestCase stub_routing <<~CALLBACK const distance = points[0].distanceTo(points[1]); const time = distance * 30; - callback(false, { + return Promise.resolve({ line: points, steps: [ [points[0], 8, "1. #{start_instruction}", distance, points], @@ -53,10 +53,8 @@ class DirectionsSystemTest < ApplicationSystemTestCase execute_script <<~SCRIPT $(() => { for (const engine of OSM.Directions.engines) { - engine.getRoute = (points, callback) => { - setTimeout(() => { + engine.getRoute = (points, signal) => { #{callback_code} - }); }; } });