From 3bd466f03deef743e7e93486376da2c8a217e217 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Mon, 29 Jul 2024 18:42:41 +0300 Subject: [PATCH] WIP --- test/interaction_events.test.js | 76 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/test/interaction_events.test.js b/test/interaction_events.test.js index 572cad606..fb956bbd9 100644 --- a/test/interaction_events.test.js +++ b/test/interaction_events.test.js @@ -94,7 +94,7 @@ test('ensure user interactions fire right events', async (t) => { // The sequence of these tests matters: each uses state established // in the prior tests. These variables keep track of bits of that state. - await t.skip('enter draw_point mode', () => { + await t.test('enter draw_point mode', () => { fireSpy.resetHistory(); // Click the line button @@ -114,7 +114,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('create a point', async () => { + await t.test('create a point', async () => { // Now in `draw_point` mode ... // Move around, then click to create the point map.fire('mousemove', makeMouseEvent(10, 10)); @@ -142,7 +142,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('deselect that point', async () => { + await t.test('deselect that point', async () => { // Now in `simple_select` mode ... // Move around, then click away from the selected point map.fire('mousemove', makeMouseEvent(10, 10)); @@ -158,7 +158,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('re-select that point', async () => { + await t.test('re-select that point', async () => { // Now in `simple_select` mode ... // Move around, then click the existing point map.fire('mousemove', makeMouseEvent(10, 10)); @@ -183,7 +183,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('drag that point', async () => { + await t.test('drag that point', async () => { // Now in `simple_select` mode ... map.fire('mousedown', makeMouseEvent(25, 25)); repeat(10, (i) => { @@ -200,7 +200,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('delete that point with the Trash button', async () => { + await t.test('delete that point with the Trash button', async () => { // Now in `simple_select` mode ... trashButton.click(); await afterNextRender(); @@ -212,7 +212,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('enter draw_line_string mode', () => { + await t.test('enter draw_line_string mode', () => { // Click the line button lineButton.click(); firedWith('draw.modechange', { @@ -232,7 +232,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('create a line', async () => { + await t.test('create a line', async () => { // Now in `draw_line_string` mode... // Move around, then click and move to create the line map.fire('mousemove', makeMouseEvent(10, 10)); @@ -270,7 +270,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('deselect that line', async () => { + await t.test('deselect that line', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(5, 5)); await afterNextRender(); @@ -283,7 +283,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('re-select that line', async () => { + await t.test('re-select that line', async () => { // Now in `simple_select` mode ... // Click somewhere on the line click(map, makeMouseEvent(30, 30)); @@ -306,7 +306,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('move the line', async () => { + await t.test('move the line', async () => { // Now in `simple_select` mode ... // Mousedown anywhere on the line, not vertex map.fire('mousedown', makeMouseEvent(20, 20)); @@ -329,7 +329,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('select a vertex', async () => { + await t.test('select a vertex', async () => { // Now in `simple_select` mode ... // Click a vertex click(map, makeMouseEvent(40, 20)); @@ -367,7 +367,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('move the vertex', async () => { + await t.test('move the vertex', async () => { // Now in `direct_select` mode ... // Click the vertex again map.fire('mousedown', makeMouseEvent(40, 20)); @@ -399,7 +399,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('add another vertex', async () => { + await t.test('add another vertex', async () => { // Now in `direct_select` mode ... // Click a midpoint of lineC click(map, makeMouseEvent(41, 21)); @@ -422,7 +422,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('delete a vertex with Backspace', async () => { + await t.test('delete a vertex with Backspace', async () => { // Now in `direct_select` mode ... // Click a vertex click(map, makeMouseEvent(41, 21)); @@ -441,7 +441,7 @@ test('ensure user interactions fire right events', async (t) => { // Leaving that line in place while moving on to // mess with polygons - await t.skip('enter draw_polygon mode', async () => { + await t.test('enter draw_polygon mode', async () => { // Click the polygon button polygonButton.click(); @@ -471,7 +471,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('create a polygon', async () => { + await t.test('create a polygon', async () => { // Now in `draw_polygon` mode ... click(map, makeMouseEvent(0, 0)); repeat(20, (i) => { @@ -510,7 +510,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('deselect the polygon', async () => { + await t.test('deselect the polygon', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(-10, -10)); @@ -525,7 +525,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('box-select the line and the polygon', async () => { + await t.test('box-select the line and the polygon', async () => { // Now in `simple_select` mode ... // Mouse down with the shift key map.fire('mousedown', makeMouseEvent(200, 200, { shiftKey: true })); @@ -563,7 +563,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('move the line and the polygon', async () => { + await t.test('move the line and the polygon', async () => { // Now in `simple_select` mode ... // Mousedown anywhere on either feature, not a vertex map.fire('mousedown', makeMouseEvent(0, 15)); @@ -586,7 +586,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('deselect both', async () => { + await t.test('deselect both', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(-10, -10)); @@ -601,7 +601,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('select the polygon', async () => { + await t.test('select the polygon', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(48, 0)); @@ -616,7 +616,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('select a vertex', async () => { + await t.test('select a vertex', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(20, -20)); @@ -644,7 +644,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('add another vertex to the selection', async () => { + await t.test('add another vertex to the selection', async () => { // Now in `simple_select` mode ... click(map, makeMouseEvent(20, 10, { shiftKey: true })); await afterNextRender(); @@ -660,7 +660,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('move the vertices', async () => { + await t.test('move the vertices', async () => { // Now in `direct_select` mode ... // Click a vertex again map.fire('mousedown', makeMouseEvent(20, 10)); @@ -692,7 +692,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('add another vertex', async () => { + await t.test('add another vertex', async () => { // Now in `direct_select` mode ... // Click a midpoint click(map, makeMouseEvent(25, 10)); @@ -717,7 +717,7 @@ test('ensure user interactions fire right events', async (t) => { } }; - await t.skip('select then delete two vertices with Draw.trash()', async () => { + await t.test('select then delete two vertices with Draw.trash()', async () => { // Now in `direct_select` mode ... click(map, makeMouseEvent(0, -20)); click(map, makeMouseEvent(25, 10, { shiftKey: true })); @@ -735,7 +735,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('select the polygon', async () => { + await t.test('select the polygon', async () => { // Deselect everything click(map, makeMouseEvent(-200, -200)); @@ -757,7 +757,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('add the line to the selection', async () => { + await t.test('add the line to the selection', async () => { // Now in `simple_select` mode ... // shift-click to add to selection click(map, makeMouseEvent(82, 22, { shiftKey: true })); @@ -775,7 +775,7 @@ test('ensure user interactions fire right events', async (t) => { // Below are tests to ensure that API usage to modify data does not // trigger events, only user interactions - await t.skip('API usage does not trigger events', async () => { + await t.test('API usage does not trigger events', async () => { Draw.deleteAll(); Draw.add({ type: 'Feature', @@ -805,7 +805,7 @@ test('ensure user interactions fire right events', async (t) => { assert.deepEqual(flushDrawEvents(), [], 'no unexpected draw events'); }); - await t.skip('except when the API function does not directly correspond to the event', async () => { + await t.test('except when the API function does not directly correspond to the event', async () => { const line = { type: 'Feature', properties: {}, @@ -871,7 +871,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_point mode then exit with Enter', async () => { + await t.test('start draw_point mode then exit with Enter', async () => { Draw.deleteAll(); Draw.changeMode('draw_point'); container.dispatchEvent(enterEvent); @@ -887,7 +887,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_point mode then exit with Escape', async () => { + await t.test('start draw_point mode then exit with Escape', async () => { Draw.deleteAll(); Draw.changeMode('draw_point'); container.dispatchEvent(escapeEvent); @@ -903,7 +903,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_line_string mode and drawing a line then finish with Enter', async () => { + await t.test('start draw_line_string mode and drawing a line then finish with Enter', async () => { Draw.deleteAll(); Draw.changeMode('draw_line_string'); click(map, makeMouseEvent(240, 240)); @@ -941,7 +941,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_line_string mode then exit with Escape', async () => { + await t.test('start draw_line_string mode then exit with Escape', async () => { Draw.deleteAll(); Draw.changeMode('draw_line_string'); click(map, makeMouseEvent(0, 0)); @@ -959,7 +959,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_polygon mode and drawing a polygon then finish with Enter', async () => { + await t.test('start draw_polygon mode and drawing a polygon then finish with Enter', async () => { Draw.deleteAll(); Draw.changeMode('draw_polygon'); click(map, makeMouseEvent(240, 240)); @@ -997,7 +997,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('start draw_polygon mode then exit with Escape', async () => { + await t.test('start draw_polygon mode then exit with Escape', async () => { Draw.deleteAll(); Draw.changeMode('draw_polygon'); click(map, makeMouseEvent(0, 0)); @@ -1015,7 +1015,7 @@ test('ensure user interactions fire right events', async (t) => { ], 'no unexpected draw events'); }); - await t.skip('box selection includes no features', async () => { + await t.test('box selection includes no features', async () => { Draw.deleteAll(); Draw.changeMode('simple_select'); click(map, makeMouseEvent(0, 0, { shiftKey: true }));