Fix sharing
This commit is contained in:
parent
1bfe7e3437
commit
3e9a988748
6 changed files with 88 additions and 13 deletions
|
|
@ -3,7 +3,7 @@ import { render, screen, waitFor } from '@testing-library/react';
|
|||
import userEvent from '@testing-library/user-event';
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { SharedQuizView } from '../../components/SharedQuizView';
|
||||
import { MemoryRouter, Routes, Route } from 'react-router-dom';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
|
||||
const mockNavigate = vi.fn();
|
||||
vi.mock('react-router-dom', async () => {
|
||||
|
|
@ -71,9 +71,7 @@ const renderWithRouter = (token: string = 'valid-token') => {
|
|||
|
||||
render(
|
||||
<MemoryRouter initialEntries={[`/shared/${token}`]}>
|
||||
<Routes>
|
||||
<Route path="/shared/:token" element={<SharedQuizView onHostQuiz={onHostQuiz} />} />
|
||||
</Routes>
|
||||
<SharedQuizView onHostQuiz={onHostQuiz} shareToken={token} />
|
||||
</MemoryRouter>
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue