-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
force jest to read papi-components es module instead of cjs, remove m…
…ock papi-components
- Loading branch information
Jolie Rabideau
authored and
Jolie Rabideau
committed
Dec 15, 2023
1 parent
c05ebf2
commit aec03f7
Showing
4 changed files
with
21 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { render, fireEvent } from '@testing-library/react'; | ||
import { Button } from 'papi-components'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
describe('Button', () => { | ||
it('renders button text correctly', () => { | ||
const buttonText = 'Click me'; | ||
const { getByText } = render(<Button>{buttonText}</Button>); | ||
expect(getByText(buttonText)).toBeInTheDocument(); | ||
}); | ||
|
||
it('handles click event correctly', () => { | ||
const handleClick = jest.fn(); | ||
const { getByText } = render(<Button onClick={handleClick}>Click me</Button>); | ||
|
||
fireEvent.click(getByText('Click me')); | ||
|
||
expect(handleClick).toHaveBeenCalledTimes(1); | ||
}); | ||
}); |
13 changes: 0 additions & 13 deletions
13
src/renderer/components/docking/platform-dock-layout.component.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters