UNPKG

@vertisanpro/flowbite-react

Version:

Non-Official React components built for Flowbite and Tailwind CSS

17 lines (16 loc) 691 B
import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { describe, expect, it } from 'vitest'; import { Banner } from './Banner'; describe('Components / Banner', () => { it('should close when collapse button is clicked', async () => { const user = userEvent.setup(); render(React.createElement("div", null, React.createElement(Banner, null, React.createElement(Banner.CollapseButton, null, "Click me")))); await user.tab(); await user.keyboard('[Space]'); expect(screen.queryByRole('banner')).not.toBeInTheDocument(); }); });