UNPKG

@eureca/eureca-ui

Version:

UI component library of Eureca's user and admin apps

24 lines (17 loc) 681 B
import React from 'react'; import { BottomFab } from '../bottom-fab'; import { render } from '@testing-library/react'; const onClickMock = jest.fn(); function renderBottomFab({ onClick }) { return render(<BottomFab onClick={onClick} data-testid="bottomfab-testid" />); } describe('BottomFab component', () => { it('is bottom right fixed', async () => { const { getByTestId } = renderBottomFab({ onClick: onClickMock }); const element = getByTestId('bottomfab-testid').parentNode; const { bottom, right, position } = window.getComputedStyle(element); expect(bottom).toBe('0px'); expect(right).toBe('0px'); expect(position).toBe('fixed'); }); });