Hide image controls when tagging, and hide compass HUD by default (#7028)

* make compass HUD configurable and hide image controls when tagging

* lint fixes

* address PR comments

* change prop to inject

---------

Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
This commit is contained in:
Scott Bell
2023-09-28 05:58:24 +02:00
committed by GitHub
parent c3b5e4e1e3
commit ab0e2d2c96
5 changed files with 40 additions and 8 deletions

View File

@ -57,6 +57,10 @@ test.describe('Example Imagery Object', () => {
await mouseZoomOnImageAndAssert(page, -2);
});
test('Compass HUD should be hidden by default', async ({ page }) => {
await expect(page.locator('.c-hud')).toBeHidden();
});
test('Can adjust image brightness/contrast by dragging the sliders', async ({
page,
browserName
@ -198,7 +202,7 @@ test.describe('Example Imagery Object', () => {
expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y);
});
test('Can use alt+shift+drag to create a tag', async ({ page }) => {
test('Can use alt+shift+drag to create a tag and ensure toolbars disappear', async ({ page }) => {
const canvas = page.locator('canvas');
await canvas.hover({ trial: true });
@ -211,7 +215,11 @@ test.describe('Example Imagery Object', () => {
// steps not working for me here
await page.mouse.move(canvasCenterX - 20, canvasCenterY - 20);
await page.mouse.move(canvasCenterX - 100, canvasCenterY - 100);
// toolbar should hide when we're creating annotations with a drag
await expect(page.locator('[role="toolbar"][aria-label="Image controls"]')).toBeHidden();
await page.mouse.up();
// toolbar should reappear when we're done creating annotations
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.