rest API added
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user