fix(hotkeyBindings): consolidate Escape hotkey behavior for contour drawing tools (#6104)
* fix(hotkeyBindings): consolidate Escape hotkey behavior for contour drawing tools * PR feedback. * PR feedback.
This commit is contained in:
1 parent
b7c8b865dd
commit
661ecb5b2e
12 files changed
+442
-12
No files matched your search
@@ -84,6 +84,41 @@ test('should restore viewport interactivity after deleting an in-progress Spline
|
||||
await expect(activeViewport.nthAnnotation(0).locator).toBeVisible();
|
||||
});
|
||||
|
||||
test('should cancel an in-progress Spline annotation via Escape', async ({
|
||||
page,
|
||||
DOMOverlayPageObject,
|
||||
mainToolbarPageObject,
|
||||
viewportPageObject,
|
||||
}) => {
|
||||
await mainToolbarPageObject.measurementTools.splineROI.click();
|
||||
|
||||
const activeViewport = await viewportPageObject.active;
|
||||
await activeViewport.clickAt([
|
||||
{ x: 380, y: 299 },
|
||||
{ x: 420, y: 236 },
|
||||
{ x: 523, y: 232 },
|
||||
]);
|
||||
|
||||
// Ensure the three points clicked above are rendered in the DOM before pressing Escape
|
||||
await expect(activeViewport.svg('circle')).toHaveCount(3);
|
||||
await press({ page, key: 'Escape' });
|
||||
|
||||
// Pressing Escape should cancel the in-progress Spline annotation
|
||||
await expect(activeViewport.nthAnnotation(0).locator).toBeHidden();
|
||||
|
||||
// Draw and complete a new Spline annotation to verify interactivity is restored
|
||||
await activeViewport.clickAt([
|
||||
{ x: 380, y: 299 },
|
||||
{ x: 420, y: 236 },
|
||||
{ x: 523, y: 232 },
|
||||
{ x: 581, y: 287 },
|
||||
{ x: 482, y: 333 },
|
||||
{ x: 383, y: 301 },
|
||||
]);
|
||||
await DOMOverlayPageObject.viewport.measurementTracking.confirm.click();
|
||||
await expect(activeViewport.nthAnnotation(0).locator).toBeVisible();
|
||||
});
|
||||
|
||||
test('should restore viewport interactivity after deleting an in-progress Spline annotation via Backspace', async ({
|
||||
page,
|
||||
DOMOverlayPageObject,
|
||||
|
||||
Reference in new issue
Block a user