outline-root.test.js 779 B

123456789101112131415161718192021222324252627282930
  1. import { expect } from 'chai'
  2. import { screen, render } from '@testing-library/react'
  3. import OutlineRoot from '../../../../../frontend/js/features/outline/components/outline-root'
  4. describe('<OutlineRoot />', function () {
  5. const jumpToLine = () => {}
  6. it('renders outline', function () {
  7. const outline = [
  8. {
  9. title: 'Section',
  10. line: 1,
  11. level: 10,
  12. },
  13. ]
  14. render(<OutlineRoot outline={outline} jumpToLine={jumpToLine} />)
  15. screen.getByRole('tree')
  16. expect(screen.queryByRole('link')).to.be.null
  17. })
  18. it('renders placeholder', function () {
  19. const outline = []
  20. render(<OutlineRoot outline={outline} jumpToLine={jumpToLine} />)
  21. expect(screen.queryByRole('tree')).to.be.null
  22. screen.getByRole('link')
  23. })
  24. })