import OutlineItem from '../../../../../frontend/js/features/outline/components/outline-item' describe('', function () { it('renders basic item', function () { cy.mount( ) cy.findByRole('treeitem', { current: false }) cy.findByRole('button', { name: 'Test Title' }) cy.findByRole('button', { name: 'Collapse' }).should('not.exist') }) it('collapses and expands', function () { cy.mount( ) cy.findByRole('button', { name: 'Child' }) cy.findByRole('button', { name: 'Collapse' }).click() cy.findByRole('button', { name: 'Expand' }) cy.findByRole('button', { name: 'Child' }).should('not.exist') }) it('highlights', function () { cy.mount( ) cy.findByRole('treeitem', { current: true }) }) it('highlights when has collapsed highlighted child', function () { cy.mount( ) cy.findByRole('treeitem', { name: 'Parent', current: false }) cy.findByRole('treeitem', { name: 'Child', current: true }) cy.findByRole('button', { name: 'Collapse' }).click() cy.findByRole('treeitem', { name: 'Parent', current: true }) }) it('click and double-click jump to location', function () { cy.mount( ) cy.findByRole('button', { name: 'Parent' }).click() cy.get('@jumpToLine').should('have.been.calledOnceWith', 1, false) cy.findByRole('button', { name: 'Parent' }).dblclick() cy.get('@jumpToLine').should('have.been.calledThrice') cy.get('@jumpToLine').should('have.been.calledWith', 1, true) }) })