overleaf/services/web/test/frontend/features/outline/components/outline-root.spec.tsx
Alf Eaton c2b553e915 [ide-react] Improve file tree and outline components in the editor sidebar (#16225)
* Upgrade react-resizable-panels
* Add FileTreeOpenProvider
* Add OutlineProvider and OutlineContainer
* Convert Outline tests to Cypress

GitOrigin-RevId: afd9ae8190edf37642e36a4ffb331f1182c8982d
2023-12-18 09:03:53 +00:00

22 lines
583 B
TypeScript

import OutlineRoot from '../../../../../frontend/js/features/outline/components/outline-root'
describe('<OutlineRoot />', function () {
it('renders outline', function () {
cy.mount(
<OutlineRoot
outline={[{ title: 'Section', line: 1, level: 10 }]}
jumpToLine={cy.stub()}
/>
)
cy.findByRole('tree')
cy.findByRole('link').should('not.exist')
})
it('renders placeholder', function () {
cy.mount(<OutlineRoot outline={[]} jumpToLine={cy.stub()} />)
cy.findByRole('tree').should('not.exist')
cy.findByRole('link')
})
})