import { Fragment } from 'react'; import { render, screen } from '@testing-library/react'; import { LoginPage } from '../LoginPage'; import { ListVariant } from '../../List'; const needAccountMessage = ( Login to your account Need an account? ); test('check loginpage example against snapshot', () => { const { asFragment } = render( ); expect(asFragment()).toMatchSnapshot(); }); test('brand is absent without brandImgSrc and brandImgProps.src', () => { const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); test('brand is present with brandImgSrc prop', () => { const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); }); test('brandImgProps successfully renders brand with props', () => { render( ); const brandImg = screen.getByRole('img', { name: 'PatternFly logo' }); expect(brandImg).toHaveAttribute('src', 'Brand src'); expect(brandImg).toHaveAttribute('alt', 'Pf-logo'); expect(brandImg).toHaveAttribute('aria-label', 'PatternFly logo'); expect(brandImg).toHaveClass('custom-class'); }); test('Brand is rendered correctly with both brandImgSrc and brandImgProps, prioritizing brandImgProps.src', () => { render( ); const brandImg = screen.getByRole('img', { name: 'Pf-logo from props' }); expect(brandImg).toHaveAttribute('src', 'Brand-src-from-props'); expect(brandImg).toHaveAttribute('alt', 'Pf-logo from props'); });