mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
test: update HistoryView delete task test to handle confirmation dialog
This commit is contained in:
parent
fc660a52e5
commit
1922b8aea9
1 changed files with 6 additions and 1 deletions
|
|
@ -135,7 +135,7 @@ describe("HistoryView", () => {
|
|||
})
|
||||
})
|
||||
|
||||
it("handles task deletion", () => {
|
||||
it("handles task deletion", async () => {
|
||||
const onDone = jest.fn()
|
||||
render(<HistoryView onDone={onDone} />)
|
||||
|
||||
|
|
@ -143,9 +143,14 @@ describe("HistoryView", () => {
|
|||
const taskContainer = screen.getByTestId("virtuoso-item-1")
|
||||
fireEvent.mouseEnter(taskContainer)
|
||||
|
||||
// Click delete button to open confirmation dialog
|
||||
const deleteButton = within(taskContainer).getByTitle("Delete Task")
|
||||
fireEvent.click(deleteButton)
|
||||
|
||||
// Find and click the confirm delete button in the dialog
|
||||
const confirmDeleteButton = screen.getByRole("button", { name: /delete/i })
|
||||
fireEvent.click(confirmDeleteButton)
|
||||
|
||||
// Verify vscode message was sent
|
||||
expect(vscode.postMessage).toHaveBeenCalledWith({
|
||||
type: "deleteTaskWithId",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue