Преглед на файлове

test: add test for SignOutDialog Cancel button

Ensure that clicking the Cancel button does not trigger
reset or navigation actions in the SignOutDialog component.
satnaing преди 2 месеца
родител
ревизия
b212358e0a
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      src/components/sign-out-dialog.test.tsx

+ 11 - 0
src/components/sign-out-dialog.test.tsx

@@ -42,4 +42,15 @@ describe('SignOutDialog', () => {
       replace: true,
     })
   })
+
+  it('does not call reset or navigate when Cancel is clicked', async () => {
+    const { getByRole } = await render(
+      <SignOutDialog open onOpenChange={vi.fn()} />
+    )
+
+    await userEvent.click(getByRole('button', { name: /^Cancel$/i }))
+
+    expect(reset).not.toHaveBeenCalled()
+    expect(navigate).not.toHaveBeenCalled()
+  })
 })