diff --git a/cypress/e2e/nodes_spec.cy.js b/cypress/e2e/nodes_spec.cy.js index 39ad7a4..2651879 100644 --- a/cypress/e2e/nodes_spec.cy.js +++ b/cypress/e2e/nodes_spec.cy.js @@ -133,6 +133,17 @@ describe('Solution Navigator', () => { cy.get('[data-test-node-title]').should('have.text', 'my child node level 1'); }); + it('expands the node hidding the side panel', () => { + cy.visit(`/nodes/${rootNodeUuid}`, { + onBeforeLoad(win) { + win.localStorage.setItem('NodeStore', JSON.stringify(initialState)); + }, + }); + + cy.get('[data-test-node-expand]').click(); + cy.get('.side-panel').should('not.be.visible'); + }); + context('when the node does not exist', () => { it('displays a not found message', () => { cy.visit('/nodes/62090d47-3104-4d50-b384-54728a0208dd'); diff --git a/specs/views/NodeShow.spec.js b/specs/views/NodeShow.spec.js index 9e93a4a..b0b6cb7 100644 --- a/specs/views/NodeShow.spec.js +++ b/specs/views/NodeShow.spec.js @@ -105,6 +105,15 @@ describe('NodeShow', () => { }); }); + describe('when clicking the expand node button', () => { + it('emits a toggle expand event', async () => { + const wrapper = createWrapper(); + + await wrapper.find('[data-test-node-expand]').trigger('click'); + expect(wrapper.emitted('toggleExpand')).toBeTruthy(); + }); + }); + describe('when the node does not exist', () => { it('emits a node not found event', () => { const wrapper = createWrapper([]); diff --git a/src/views/HomeIndex.vue b/src/views/HomeIndex.vue index 0d6c7a4..1997574 100644 --- a/src/views/HomeIndex.vue +++ b/src/views/HomeIndex.vue @@ -1,4 +1,5 @@