diff --git a/CommonUI/src/Tests/Button.test.tsx b/CommonUI/src/Tests/Button.test.tsx index 84669b1fbb..3a902163bc 100644 --- a/CommonUI/src/Tests/Button.test.tsx +++ b/CommonUI/src/Tests/Button.test.tsx @@ -1,35 +1,35 @@ import React from 'react'; -import { create } from 'react-test-renderer'; +import { render, screen, fireEvent } from '@testing-library/react'; +import '@testing-library/jest-dom/extend-expect'; import Button from '../Components/Button/Button'; -describe('Button', () => { - const button = create( - `); + test('it should render correctly with a test id', () => { + expect(testId).toBeInTheDocument; + }); + + test('it should have a title', () => { + expect(title).toBeInTheDocument; + }); + + test('it should have disabled attribute', () => { + expect(testId).toHaveAttribute('disabled'); + }); + + test('it should handle onClick event', () => { + fireEvent.click(testId); + expect(handleClick).toBeCalled; }); });