ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
880 B

  1. import { screen } from '@testing-library/react'
  2. import { Route, Routes } from 'react-router-dom'
  3. import { describe, expect, it, vi } from 'vitest'
  4. import MaterialBasePage from '@/pages/materials/MaterialBasePage'
  5. import { renderWithProviders } from '@/test/render'
  6. vi.mock ('@/components/MaterialSidebar', () => ({
  7. default: () => <aside>Material sidebar</aside>,
  8. }))
  9. describe ('MaterialBasePage', () => {
  10. it ('renders the material sidebar and nested route outlet', () => {
  11. renderWithProviders (
  12. <Routes>
  13. <Route path="/materials" element={<MaterialBasePage/>}>
  14. <Route index element={<div>Outlet content</div>}/>
  15. </Route>
  16. </Routes>,
  17. { route: '/materials' },
  18. )
  19. expect (screen.getByText ('Material sidebar')).toBeInTheDocument ()
  20. expect (screen.getByText ('Outlet content')).toBeInTheDocument ()
  21. })
  22. })