Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -14,26 +14,29 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from "react";
|
||||
import { render } from "@testing-library/react";
|
||||
|
||||
import { Caption } from '../../../../src/components/views/typography/Caption';
|
||||
import { Caption } from "../../../../src/components/views/typography/Caption";
|
||||
|
||||
describe('<Caption />', () => {
|
||||
describe("<Caption />", () => {
|
||||
const defaultProps = {
|
||||
'children': 'test',
|
||||
'data-testid': 'test test id',
|
||||
"children": "test",
|
||||
"data-testid": "test test id",
|
||||
};
|
||||
const getComponent = (props = {}) =>
|
||||
(<Caption {...defaultProps} {...props} />);
|
||||
const getComponent = (props = {}) => <Caption {...defaultProps} {...props} />;
|
||||
|
||||
it('renders plain text children', () => {
|
||||
it("renders plain text children", () => {
|
||||
const { container } = render(getComponent());
|
||||
expect({ container }).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders react children', () => {
|
||||
const children = <>Test <b>test but bold</b></>;
|
||||
it("renders react children", () => {
|
||||
const children = (
|
||||
<>
|
||||
Test <b>test but bold</b>
|
||||
</>
|
||||
);
|
||||
const { container } = render(getComponent({ children }));
|
||||
expect({ container }).toMatchSnapshot();
|
||||
});
|
||||
|
|
|
@ -14,35 +14,37 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { renderIntoDocument } from 'react-dom/test-utils';
|
||||
import React from "react";
|
||||
import { renderIntoDocument } from "react-dom/test-utils";
|
||||
|
||||
import Heading from "../../../../src/components/views/typography/Heading";
|
||||
describe('<Heading />', () => {
|
||||
describe("<Heading />", () => {
|
||||
const defaultProps = {
|
||||
size: 'h1',
|
||||
size: "h1",
|
||||
children: <div>test</div>,
|
||||
['data-test-id']: 'test',
|
||||
className: 'test',
|
||||
["data-test-id"]: "test",
|
||||
className: "test",
|
||||
} as any;
|
||||
const getComponent = (props = {}) => {
|
||||
const wrapper = renderIntoDocument<HTMLDivElement>(
|
||||
<div><Heading {...defaultProps} {...props} /></div>,
|
||||
<div>
|
||||
<Heading {...defaultProps} {...props} />
|
||||
</div>,
|
||||
) as HTMLDivElement;
|
||||
return wrapper.children[0];
|
||||
};
|
||||
|
||||
it('renders h1 with correct attributes', () => {
|
||||
expect(getComponent({ size: 'h1' })).toMatchSnapshot();
|
||||
it("renders h1 with correct attributes", () => {
|
||||
expect(getComponent({ size: "h1" })).toMatchSnapshot();
|
||||
});
|
||||
it('renders h2 with correct attributes', () => {
|
||||
expect(getComponent({ size: 'h2' })).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 h3 with correct attributes", () => {
|
||||
expect(getComponent({ size: "h3" })).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders h4 with correct attributes', () => {
|
||||
expect(getComponent({ size: 'h4' })).toMatchSnapshot();
|
||||
it("renders h4 with correct attributes", () => {
|
||||
expect(getComponent({ size: "h4" })).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue