Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jul 29, 2024
1 parent 9452b6c commit 3bd466f
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions test/interaction_events.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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) => {
Expand All @@ -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();
Expand All @@ -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', {
Expand All @@ -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));
Expand Down Expand Up @@ -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();
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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();

Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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));

Expand All @@ -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 }));
Expand Down Expand Up @@ -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));
Expand All @@ -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));

Expand All @@ -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));

Expand All @@ -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));

Expand Down Expand Up @@ -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();
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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 }));
Expand All @@ -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));

Expand All @@ -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 }));
Expand All @@ -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',
Expand Down Expand Up @@ -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: {},
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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 }));
Expand Down

0 comments on commit 3bd466f

Please sign in to comment.