소스 검색

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()
+  })
 })