Skip to content

Commit

Permalink
fix: 関数のモックを作成し、propsとして渡すように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
cw-ryo.yashiro committed Jun 8, 2024
1 parent b8094a4 commit e2e427c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion frontend/src/components/ui-domain/TaskLists/TaskLists.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,22 @@ const setup = () => {

describe("ui-domain/TaskLists", () => {
const { todos } = setup()
let updateTask = () => {}
let deleteTask = () => {}

beforeEach(() => {
updateTask = vi.fn()
deleteTask = vi.fn()
})

it("[role='list']", () => {
render(<TaskLists todos={todos} />)
render(
<TaskLists
todos={todos}
updateTask={updateTask}
deleteTask={deleteTask}
/>
)
expect(screen.getByRole("list")).toBeInTheDocument()
expect(screen.getByText("タスク1")).toBeTruthy()
})
Expand Down

0 comments on commit e2e427c

Please sign in to comment.