mirror of
https://github.com/nasa/openmct.git
synced 2025-05-08 11:38:35 +00:00
* Add double click event to expand image view * Add performance tests for large view and close button * Add example imagery in flexible layout to test double-click functionality * Remove click event listener in ImageryView.vue * Move test to 'Example Imagery in Flexible layout' * Refactor exampleImagery.e2e.spec.js * Remove unnecessary code for opening and closing large view in imagery.contract.per.spec.js * Replace pageSelector with getByRole on double-click image test * Add role and aria-label to focused image * Remove unnecessary code and role attribute from ImageryView.vue --------- Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
This commit is contained in:
parent
6ce340cebd
commit
11f3ce9470
@ -485,6 +485,33 @@ test.describe('Example Imagery in Display Layout', () => {
|
|||||||
|
|
||||||
test.describe('Example Imagery in Flexible layout', () => {
|
test.describe('Example Imagery in Flexible layout', () => {
|
||||||
let flexibleLayout;
|
let flexibleLayout;
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
|
flexibleLayout = await createDomainObjectWithDefaults(page, { type: 'Flexible Layout' });
|
||||||
|
|
||||||
|
// Create Example Imagery inside the Flexible Layout
|
||||||
|
await createDomainObjectWithDefaults(page, {
|
||||||
|
type: 'Example Imagery',
|
||||||
|
parent: flexibleLayout.uuid
|
||||||
|
});
|
||||||
|
|
||||||
|
// Navigate back to Flexible Layout
|
||||||
|
await page.goto(flexibleLayout.url);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can double-click on the image to view large image', async ({ page }) => {
|
||||||
|
// Double-click on the image to open large view
|
||||||
|
const imageElement = await page.getByRole('button', { name: 'Image Wrapper' });
|
||||||
|
await imageElement.dblclick();
|
||||||
|
|
||||||
|
// Check if the large view is visible
|
||||||
|
await page.getByRole('button', { name: 'Background Image', state: 'visible' });
|
||||||
|
|
||||||
|
// Close the large view
|
||||||
|
await page.getByLabel('Close').click();
|
||||||
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
@ -580,6 +607,7 @@ test.describe('Example Imagery in Time Strip', () => {
|
|||||||
// Navigate to timestrip
|
// Navigate to timestrip
|
||||||
await page.goto(timeStripObject.url);
|
await page.goto(timeStripObject.url);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Clicking a thumbnail loads the image in large view', async ({ page, browserName }) => {
|
test('Clicking a thumbnail loads the image in large view', async ({ page, browserName }) => {
|
||||||
test.info().annotations.push({
|
test.info().annotations.push({
|
||||||
type: 'issue',
|
type: 'issue',
|
||||||
|
@ -46,18 +46,26 @@
|
|||||||
@start-pan="startPan"
|
@start-pan="startPan"
|
||||||
@toggle-layer-visibility="toggleLayerVisibility"
|
@toggle-layer-visibility="toggleLayerVisibility"
|
||||||
/>
|
/>
|
||||||
<div ref="imageBG" class="c-imagery__main-image__bg" @click="expand">
|
<div
|
||||||
|
ref="imageBG"
|
||||||
|
class="c-imagery__main-image__bg"
|
||||||
|
aria-label="Background Image"
|
||||||
|
role="button"
|
||||||
|
>
|
||||||
<div v-if="zoomFactor > 1" class="c-imagery__hints">
|
<div v-if="zoomFactor > 1" class="c-imagery__hints">
|
||||||
{{ formatImageAltText }}
|
{{ formatImageAltText }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
role="button"
|
||||||
ref="focusedImageWrapper"
|
ref="focusedImageWrapper"
|
||||||
class="image-wrapper"
|
class="image-wrapper"
|
||||||
|
aria-label="Image Wrapper"
|
||||||
:style="{
|
:style="{
|
||||||
width: `${sizedImageWidth}px`,
|
width: `${sizedImageWidth}px`,
|
||||||
height: `${sizedImageHeight}px`
|
height: `${sizedImageHeight}px`
|
||||||
}"
|
}"
|
||||||
@mousedown="handlePanZoomClick"
|
@mousedown="handlePanZoomClick"
|
||||||
|
@dblclick="expand"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(layer, index) in visibleLayers"
|
v-for="(layer, index) in visibleLayers"
|
||||||
@ -66,6 +74,7 @@
|
|||||||
:style="getVisibleLayerStyles(layer)"
|
:style="getVisibleLayerStyles(layer)"
|
||||||
></div>
|
></div>
|
||||||
<img
|
<img
|
||||||
|
aria-label="Focused Image"
|
||||||
ref="focusedImage"
|
ref="focusedImage"
|
||||||
class="c-imagery__main-image__image js-imageryView-image"
|
class="c-imagery__main-image__image js-imageryView-image"
|
||||||
:src="imageUrl"
|
:src="imageUrl"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user