rest API added

This commit is contained in:
gitea
2026-02-14 15:13:26 +01:00
parent c8ff07b490
commit d99b051a07
30 changed files with 1872 additions and 616 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ describe('DeckPreview', () => {
render(DeckPreview, { props: { params: { id: 'd1' } } })
expect(screen.getByText('Loading deck…')).toBeInTheDocument()
await waitFor(() => expect(screen.getByText('Preview Deck')).toBeInTheDocument())
expect(mockFetchDeckWithQuestions).toHaveBeenCalledWith('d1')
expect(mockFetchDeckWithQuestions).toHaveBeenCalledWith(expect.anything(), 'd1')
})
it('shows error when deck not available', async () => {
@@ -71,7 +71,7 @@ describe('DeckPreview', () => {
const addBtn = screen.getByRole('button', { name: /Add to My decks/i })
mockCopyDeckToUser.mockResolvedValue(undefined)
await fireEvent.click(addBtn)
await waitFor(() => expect(mockCopyDeckToUser).toHaveBeenCalledWith('d1', 'u1'))
await waitFor(() => expect(mockCopyDeckToUser).toHaveBeenCalledWith(expect.anything(), 'd1', 'u1'))
})
it('addToMyDecks without userId shows sign in error', async () => {