e45cd39906
* add h4 Signed-off-by: Kerry Archibald <kerrya@element.io> * add mixin to clear list style Signed-off-by: Kerry Archibald <kerrya@element.io> * add basic sidebar container Signed-off-by: Kerry Archibald <kerrya@element.io> * open list view button on beaconviewdialog Signed-off-by: Kerry Archibald <kerrya@element.io> * update tests for new utils Signed-off-by: Kerry Archibald <kerrya@element.io>
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { renderIntoDocument } from 'react-dom/test-utils';
|
|
|
|
import Heading from "../../../../src/components/views/typography/Heading";
|
|
describe('<Heading />', () => {
|
|
const defaultProps = {
|
|
size: 'h1',
|
|
children: <div>test</div>,
|
|
['data-test-id']: 'test',
|
|
className: 'test',
|
|
} as any;
|
|
const getComponent = (props = {}) => {
|
|
const wrapper = renderIntoDocument<HTMLDivElement>(
|
|
<div><Heading {...defaultProps} {...props} /></div>,
|
|
) as HTMLDivElement;
|
|
return wrapper.children[0];
|
|
};
|
|
|
|
it('renders h1 with correct attributes', () => {
|
|
expect(getComponent({ size: 'h1' })).toMatchSnapshot();
|
|
});
|
|
it('renders h2 with correct attributes', () => {
|
|
expect(getComponent({ size: 'h2' })).toMatchSnapshot();
|
|
});
|
|
it('renders h3 with correct attributes', () => {
|
|
expect(getComponent({ size: 'h3' })).toMatchSnapshot();
|
|
});
|
|
|
|
it('renders h4 with correct attributes', () => {
|
|
expect(getComponent({ size: 'h4' })).toMatchSnapshot();
|
|
});
|
|
});
|