import React from 'react'; import { render, screen } from '@testing-library/react'; import ButtonClose from '../ButtonClose'; import ButtonKDS from '../ButtonKDS'; import { ThemeProvider } from 'styled-components'; const theme = { colors: { main: '#000', default: '#fff', success: 'rgb(71, 176, 75)', background: '#ffc200', }, fontSizes: { medium: '16px', }, }; interface Props { children: React.ReactNode; } const KDSTheme = ({ children }: Props) => ( {children} ); const mockedSetZoomIn = jest.fn(); describe('ButtonClose', () => { it('should render button close element', () => { render(); const buttonElement = screen.getByTestId('close-button'); expect(buttonElement).toBeInTheDocument(); }); it('should render zoom in button', () => { render( ); const buttonElement = screen.getByText('Zoom In'); expect(buttonElement).toBeInTheDocument(); }); it('should render white button', () => { render( ); const buttonElement = screen.getByText('Zoom In'); expect(buttonElement).toHaveStyle('background-color:#fff'); }); it('should render button with icon', () => { render( ); const buttonElement = screen.getByText('Zoom In'); const graphicElement = screen.getByTestId('magnifier-icon'); expect(buttonElement).toContainElement(graphicElement); }); it('should render success button', () => { render( ); const buttonElement = screen.getByText('Zoom In'); expect(buttonElement).toHaveStyle('background-color:rgb(71, 176, 75)'); }); });