fixing tests

This commit is contained in:
Jamie V 2023-01-05 12:39:49 -08:00
parent e48f419db7
commit 4b08aa93e6
2 changed files with 5 additions and 5 deletions

View File

@ -152,7 +152,7 @@ test.describe('Restricted Notebook with a page locked and with an embed @addInit
test('Allows embeds to be deleted if page unlocked @addInit', async ({ page }) => {
// Click .c-ne__embed__name .c-popup-menu-button
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
await page.locator('.c-ne__embed__name .c-icon-button').click(); // embed popup menu
const embedMenu = page.locator('body >> .c-menu');
await expect(embedMenu).toContainText('Remove This Embed');
@ -161,7 +161,7 @@ test.describe('Restricted Notebook with a page locked and with an embed @addInit
test('Disallows embeds to be deleted if page locked @addInit', async ({ page }) => {
await lockPage(page);
// Click .c-ne__embed__name .c-popup-menu-button
await page.locator('.c-ne__embed__name .c-popup-menu-button').click(); // embed popup menu
await page.locator('.c-ne__embed__name .c-icon-button').click(); // embed popup menu
const embedMenu = page.locator('body >> .c-menu');
await expect(embedMenu).not.toContainText('Remove This Embed');

View File

@ -70,8 +70,7 @@ export default {
},
data() {
return {
menuActions: [],
objectPath: []
menuActions: []
};
},
computed: {
@ -94,6 +93,7 @@ export default {
}
},
async mounted() {
this.objectPath = [];
await this.setEmbedObjectPath();
this.addMenuActions();
this.imageExporter = new ImageExporter(this.openmct);
@ -165,7 +165,7 @@ export default {
async setEmbedObjectPath() {
this.objectPath = await this.openmct.objects.getOriginalPath(this.embed.domainObject.identifier);
if (this.objectPath[this.objectPath.length - 1].type === 'root') {
if (this.objectPath.length > 0 && this.objectPath[this.objectPath.length - 1].type === 'root') {
this.objectPath.pop();
}
},