From a207e972035df7021603b84090ebf4ccbe1395fc Mon Sep 17 00:00:00 2001 From: Jamie V <jamie.j.vigliotta@nasa.gov> Date: Thu, 20 Feb 2025 16:07:55 -0800 Subject: [PATCH] finishing up main views tests and updating some providers to fix errors --- e2e/tests/functional/ui/inspector.e2e.spec.js | 40 +++++++++++++------ .../annotations/AnnotationsViewProvider.js | 11 ++++- .../properties/PropertiesViewProvider.js | 2 +- .../styles/StylesInspectorViewProvider.js | 3 ++ 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/e2e/tests/functional/ui/inspector.e2e.spec.js b/e2e/tests/functional/ui/inspector.e2e.spec.js index 59cda89c6c..02e632d738 100644 --- a/e2e/tests/functional/ui/inspector.e2e.spec.js +++ b/e2e/tests/functional/ui/inspector.e2e.spec.js @@ -1,3 +1,5 @@ +/* eslint-disable playwright/no-conditional-in-test */ +/* eslint-disable playwright/no-conditional-expect */ /***************************************************************************** * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space @@ -96,7 +98,7 @@ const viewsTabsMatrix = { }, 'Overlay Plot': { Browse: ['Properties', 'Config', 'Annotations'], - Edit: ['Config', 'Elements', 'Styles', 'Properties'] + Edit: ['Config', 'Elements', 'Styles', 'Filters', 'Properties'] }, 'Scatter Plot': { Browse: ['Properties', 'Config', 'Elements'], @@ -106,7 +108,7 @@ const viewsTabsMatrix = { Browse: ['Properties', 'Annotations'] }, 'Stacked Plot': { - Browse: ['Properties', 'Config', 'Annotations'], + Browse: ['Properties', 'Config', 'Annotations', 'Elements'], Edit: ['Config', 'Elements', 'Styles', 'Properties'] }, 'Tabs View': { @@ -115,7 +117,7 @@ const viewsTabsMatrix = { }, 'Telemetry Table': { Browse: ['Properties', 'Config', 'Elements'], - Edit: ['Config', 'Elements', 'Styles', 'Properties'] + Edit: ['Config', 'Elements', 'Styles', 'Filters', 'Properties'] }, 'Time List': { Browse: ['Properties', 'Config', 'Elements'], @@ -178,7 +180,7 @@ const viewsTabsMatrix = { // } // }; -test.describe.only('Inspector tests', () => { +test.describe('Inspector tests', () => { test.beforeEach(async ({ page }) => { await page.goto('./', { waitUntil: 'domcontentloaded' }); }); @@ -237,17 +239,31 @@ test.describe.only('Inspector tests', () => { ); await page.goto(objectInfo.url); - // add object if necessary - // eslint-disable-next-line playwright/no-conditional-in-test - if (!noCompositionViews.includes(view)) { - // add object - } - // verify correct number of tabs for browse mode expect(await page.getByRole('tab').count()).toBe(Object.keys(viewConfig.Browse).length); + + // verify correct order of tabs for browse mode + for (const [index, value] of Object.entries(viewConfig.Browse)) { + const tab = page.getByRole('tab').nth(index); + await expect(tab).toHaveText(value); + } + // enter Edit if necessary - // check that the tabs are visible - // check that the tabs are in the correct order + if (viewConfig.Edit) { + await page.getByLabel('Edit Object').click(); + + // verify correct number of tabs for edit mode + expect(await page.getByRole('tab').count()).toBe(Object.keys(viewConfig.Edit).length); + + // verify correct order of tabs for edit mode + for (const [index, value] of Object.entries(viewConfig.Edit)) { + const tab = page.getByRole('tab').nth(index); + await expect(tab).toHaveText(value); + } + + await page.getByLabel('Save').first().click(); + await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click(); + } } }); }); diff --git a/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js b/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js index dd6f12f608..4f7d9d19bf 100644 --- a/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js +++ b/src/plugins/inspectorViews/annotations/AnnotationsViewProvider.js @@ -52,6 +52,7 @@ export default function AnnotationsViewProvider(openmct) { const selectionContext = selection?.[0]?.[0]?.context; const domainObject = selectionContext?.item; const isNotebookEntry = selectionContext?.type === 'notebook-entry-selection'; + const isConditionSet = domainObject?.type === 'conditionSet'; return { show: function (element) { @@ -75,7 +76,15 @@ export default function AnnotationsViewProvider(openmct) { _destroy = destroy; }, priority: function () { - return isNotebookEntry ? openmct.priority.HIGH + 1 : openmct.priority.DEFAULT; + if (isNotebookEntry) { + return openmct.priority.HIGH + 1; + } + + if (isConditionSet) { + return openmct.priority.LOW; + } + + return openmct.priority.DEFAULT; }, destroy: function () { if (_destroy) { diff --git a/src/plugins/inspectorViews/properties/PropertiesViewProvider.js b/src/plugins/inspectorViews/properties/PropertiesViewProvider.js index 2ecb1cc01e..8053a9e2ae 100644 --- a/src/plugins/inspectorViews/properties/PropertiesViewProvider.js +++ b/src/plugins/inspectorViews/properties/PropertiesViewProvider.js @@ -58,7 +58,7 @@ export default function PropertiesViewProvider(openmct) { _destroy = destroy; }, priority: function () { - return openmct.editor.isEditing() ? openmct.priority.LOW : openmct.priority.HIGH; + return openmct.editor.isEditing() ? openmct.priority.LOW : openmct.priority.HIGH + 2; }, destroy: function () { if (_destroy) { diff --git a/src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js b/src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js index 333a87ae5e..b5237f0b76 100644 --- a/src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js +++ b/src/plugins/inspectorViews/styles/StylesInspectorViewProvider.js @@ -38,6 +38,9 @@ const NON_STYLABLE_TYPES = [ 'notebook', 'restricted-notebook', 'summary-widget', + 'time-strip', + 'timelist', + 'timer', 'webPage' ];