Skip to content

Commit

Permalink
Add clicking delete button
Browse files Browse the repository at this point in the history
 (#147)
  • Loading branch information
kimurash committed Nov 20, 2024
1 parent 6abef6d commit 5600429
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/test/routes/home.books.bookId/route.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ describe('Book Detail Page', () => {
// 削除ボタンをクリックする
await user.click(deleteButton);

// ダイアログに削除ボタンが表示されている
const dialogDeleteButton = await screen.findByRole('button', {
name: '削除',
});
expect(dialogDeleteButton).toBeInTheDocument();

// 削除ボタンをクリックする
await user.click(dialogDeleteButton);

// ログインページへリダイレクトされる
expect(redirect).toHaveBeenCalledWith('/login', {
headers: {
Expand Down

0 comments on commit 5600429

Please sign in to comment.