From 8d51c3832e8e405cfaf9c1fa277db339d5f849ca Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Tue, 16 Jul 2024 10:05:21 -0700 Subject: [PATCH] Write first test --- packages/ui/src/Button/index.test.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/ui/src/Button/index.test.tsx diff --git a/packages/ui/src/Button/index.test.tsx b/packages/ui/src/Button/index.test.tsx new file mode 100644 index 0000000000..6c696c92b0 --- /dev/null +++ b/packages/ui/src/Button/index.test.tsx @@ -0,0 +1,17 @@ +import { describe, expect, it, vi } from 'vitest'; +import { Button } from '.'; +import { fireEvent, render } from '@testing-library/react'; +import { ThemeProvider } from '../ThemeProvider'; + +describe(', { + wrapper: ThemeProvider, + }); + + fireEvent.click(getByText('Click me')); + + expect(onClick).toHaveBeenCalledOnce(); + }); +});