mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
add some basic object path label tests
This commit is contained in:
parent
89e18d482d
commit
dd57d78c4f
@ -28,12 +28,19 @@ test.describe('Comps', () => {
|
||||
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||
});
|
||||
|
||||
test('Basic Functionality Works', async ({ page }) => {
|
||||
test('Basic Functionality Works', async ({ page, openmctConfig }) => {
|
||||
const folder = await createDomainObjectWithDefaults(page, {
|
||||
type: 'Folder'
|
||||
});
|
||||
|
||||
// Create the comps with defaults
|
||||
const comp = await createDomainObjectWithDefaults(page, { type: 'Derived Telemetry' });
|
||||
const comp = await createDomainObjectWithDefaults(page, {
|
||||
type: 'Derived Telemetry',
|
||||
parent: folder.uuid
|
||||
});
|
||||
|
||||
// Create a sine wave generator within the comp
|
||||
await createDomainObjectWithDefaults(page, {
|
||||
const sineWaveGenerator1 = await createDomainObjectWithDefaults(page, {
|
||||
type: 'Sine Wave Generator',
|
||||
parent: comp.uuid
|
||||
});
|
||||
@ -65,12 +72,22 @@ test.describe('Comps', () => {
|
||||
// should be a number
|
||||
expect(parseFloat(testValue)).not.toBeNaN();
|
||||
|
||||
// Check that object path is correct
|
||||
const { myItemsFolderName } = openmctConfig;
|
||||
let objectPath = await page.getByLabel(`${sineWaveGenerator1.name} Object Path`).textContent();
|
||||
const expectedObjectPath = `/${myItemsFolderName}/${folder.name}/${comp.name}/${sineWaveGenerator1.name}`;
|
||||
expect(objectPath).toBe(expectedObjectPath);
|
||||
|
||||
// Check that the comps are saved
|
||||
await page.getByLabel('Save').click();
|
||||
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
|
||||
const expression = await page.getByLabel('Expression', { exact: true }).textContent();
|
||||
expect(expression).toBe('b*2');
|
||||
|
||||
// Check that object path is still correct after save
|
||||
objectPath = await page.getByLabel(`${sineWaveGenerator1.name} Object Path`).textContent();
|
||||
expect(objectPath).toBe(expectedObjectPath);
|
||||
|
||||
// Check that comps work after being saved
|
||||
testValue = await page.getByLabel('Current Output Value').textContent();
|
||||
expect(testValue).not.toBe('10');
|
||||
|
@ -71,7 +71,10 @@
|
||||
/>
|
||||
<div v-else class="--em">{{ parameter.name }}</div>
|
||||
<span class="c-test-datum__string">=</span>
|
||||
<span class="c-comps__path-and-field">
|
||||
<span
|
||||
class="c-comps__path-and-field"
|
||||
:aria-label="`Reference ${parameter.name} Object Path`"
|
||||
>
|
||||
<ObjectPathString
|
||||
:domain-object="compsManager.getTelemetryObjectForParameter(parameter.keyString)"
|
||||
:show-object-itself="true"
|
||||
|
@ -24,7 +24,7 @@
|
||||
<div
|
||||
v-if="orderedPath.length"
|
||||
class="c-object-path-string"
|
||||
:aria-label="`${domainObject.name}`"
|
||||
:aria-label="`${domainObject.name} Object Path`"
|
||||
role="navigation"
|
||||
>
|
||||
{{ orderedPathStr }}
|
||||
@ -32,8 +32,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import ObjectLabel from './ObjectLabel.vue';
|
||||
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
props: {
|
||||
@ -115,7 +113,6 @@ export default {
|
||||
|
||||
this.orderedPath.forEach((pathObject) => {
|
||||
this.orderedPathStr = this.orderedPathStr.concat('/').concat(pathObject.domainObject.name);
|
||||
// this.addNameListenerFor(pathObject.domainObject);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user