From 194060f30a9f7753bd03e2542262a5eeceab423f Mon Sep 17 00:00:00 2001 From: Jamie V Date: Wed, 8 Jun 2022 13:58:49 -0700 Subject: [PATCH] [Flexible Layout] Unit test for rendering the view (#5308) * flex layout render test to boost coverage --- src/plugins/flexibleLayout/pluginSpec.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/flexibleLayout/pluginSpec.js b/src/plugins/flexibleLayout/pluginSpec.js index c88c7ffea6..470fb6e8b3 100644 --- a/src/plugins/flexibleLayout/pluginSpec.js +++ b/src/plugins/flexibleLayout/pluginSpec.js @@ -22,6 +22,7 @@ import { createOpenMct, resetApplicationState } from 'utils/testing'; import FlexibleLayout from './plugin'; +import Vue from 'vue'; describe('the plugin', function () { let element; @@ -61,7 +62,7 @@ describe('the plugin', function () { element.appendChild(child); openmct.on('start', done); - openmct.startHeadless(); + openmct.start(child); }); afterEach(() => { @@ -83,6 +84,16 @@ describe('the plugin', function () { it('provides a view', () => { expect(flexibleLayoutViewProvider).toBeDefined(); }); + + it('renders a view', async () => { + const flexibleView = flexibleLayoutViewProvider.view(testViewObject, []); + flexibleView.show(child, false); + + await Vue.nextTick(); + const flexTitle = child.querySelector('.l-browse-bar .c-object-label__name'); + + expect(flexTitle).not.toBeNull(); + }); }); describe('the toolbar', () => {