mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
Handle negative height & width in image annotations (#7116)
* add fix * remove debug code * add test for unholy rectangles * make test a bit more forgiving * address pr review
This commit is contained in:
@ -209,7 +209,6 @@ test.describe('Example Imagery Object', () => {
|
||||
const canvasBoundingBox = await canvas.boundingBox();
|
||||
const canvasCenterX = canvasBoundingBox.x + canvasBoundingBox.width / 2;
|
||||
const canvasCenterY = canvasBoundingBox.y + canvasBoundingBox.height / 2;
|
||||
|
||||
await Promise.all(tagHotkey.map((x) => page.keyboard.down(x)));
|
||||
await page.mouse.down();
|
||||
// steps not working for me here
|
||||
@ -222,7 +221,7 @@ test.describe('Example Imagery Object', () => {
|
||||
await expect(page.locator('[role="toolbar"][aria-label="Image controls"]')).toBeVisible();
|
||||
await Promise.all(tagHotkey.map((x) => page.keyboard.up(x)));
|
||||
|
||||
//Wait for canvas to stabilize.
|
||||
// Wait for canvas to stabilize.
|
||||
await canvas.hover({ trial: true });
|
||||
|
||||
// add some tags
|
||||
@ -234,6 +233,20 @@ test.describe('Example Imagery Object', () => {
|
||||
await page.getByRole('button', { name: /Add Tag/ }).click();
|
||||
await page.getByPlaceholder('Type to select tag').click();
|
||||
await page.getByText('Science').click();
|
||||
|
||||
// click on a separate part of the canvas to ensure no tags appear
|
||||
await page.mouse.click(canvasCenterX + 10, canvasCenterY + 10);
|
||||
await expect(page.getByText('Driving')).toBeHidden();
|
||||
await expect(page.getByText('Science')).toBeHidden();
|
||||
|
||||
test.info().annotations.push({
|
||||
type: 'issue',
|
||||
description: 'https://github.com/nasa/openmct/issues/7083'
|
||||
});
|
||||
// click on annotation again and expect tags to appear
|
||||
await page.mouse.click(canvasCenterX - 50, canvasCenterY - 50);
|
||||
await expect(page.getByText('Driving')).toBeVisible();
|
||||
await expect(page.getByText('Science')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Can use + - buttons to zoom on the image @unstable', async ({ page }) => {
|
||||
|
Reference in New Issue
Block a user