@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
39 lines (38 loc) • 1.83 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
/**
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
*/
import { render } from '@testing-library/react';
import { createRef } from 'react';
import { PageHeaderGridCellNarrowWindowOnly } from './PageHeaderGridCellNarrowWindowOnly';
import '@testing-library/jest-dom';
describe('Page Header Grid Cell Narrow Window Only', () => {
it('renders', () => {
const { container } = render(_jsx(PageHeaderGridCellNarrowWindowOnly, {}));
const component = container.querySelector(':only-child');
expect(component).toBeInTheDocument();
expect(component).toBeVisible();
});
it('renders a Grid.Cell', () => {
const { container } = render(_jsx(PageHeaderGridCellNarrowWindowOnly, {}));
const component = container.querySelector(':only-child');
expect(component).toHaveClass('ams-grid__cell');
});
it('renders a design system BEM class name', () => {
const { container } = render(_jsx(PageHeaderGridCellNarrowWindowOnly, {}));
const component = container.querySelector(':only-child');
expect(component).toHaveClass('ams-page-header__grid-cell-narrow-window-only');
});
it('renders an extra class name', () => {
const { container } = render(_jsx(PageHeaderGridCellNarrowWindowOnly, { className: "extra" }));
const component = container.querySelector(':only-child');
expect(component).toHaveClass('ams-page-header__grid-cell-narrow-window-only extra');
});
it('supports ForwardRef in React', () => {
const ref = createRef();
const { container } = render(_jsx(PageHeaderGridCellNarrowWindowOnly, { ref: ref }));
const component = container.querySelector(':only-child');
expect(ref.current).toBe(component);
});
});