Skip to content

Commit

Permalink
add childProps regression tests to components that already work
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 15, 2022
1 parent 7479437 commit 7dc2956
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/components/description_list/description_list.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';
import { shouldRenderCustomStyles } from '../../test/internal';

import { EuiDescriptionList } from './description_list';
import { TYPES, ALIGNMENTS, GUTTER_SIZES } from './description_list_types';
import { shouldRenderCustomStyles } from '../../test/internal';

describe('EuiDescriptionList', () => {
shouldRenderCustomStyles(<EuiDescriptionList />);
shouldRenderCustomStyles(
<EuiDescriptionList
listItems={[{ title: 'hello', description: 'world' }]}
/>,
['titleProps', 'descriptionProps']
);

test('is rendered', () => {
const component = render(
Expand Down
3 changes: 2 additions & 1 deletion src/components/expression/expression.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { EuiExpression, COLORS } from './expression';

describe('EuiExpression', () => {
shouldRenderCustomStyles(
<EuiExpression description="the answer is" value="42" />
<EuiExpression description="the answer is" value="42" />,
['descriptionProps', 'valueProps']
);

test('renders', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/page/page_body/page_body.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PADDING_SIZES } from '../../../global_styling';
import { EuiPageBody } from './page_body';

describe('EuiPageBody', () => {
shouldRenderCustomStyles(<EuiPageBody />);
shouldRenderCustomStyles(<EuiPageBody panelled />, ['panelProps']);

test('is rendered', () => {
const component = render(<EuiPageBody {...requiredProps} />);
Expand Down
2 changes: 1 addition & 1 deletion src/components/page_template/page_template.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PADDING_SIZES } from '../../global_styling';
import { EuiPageTemplate } from './page_template';

describe('EuiPageTemplate', () => {
shouldRenderCustomStyles(<EuiPageTemplate />);
shouldRenderCustomStyles(<EuiPageTemplate />, ['mainProps']);

test('is rendered', () => {
const component = render(<EuiPageTemplate {...requiredProps} />);
Expand Down

0 comments on commit 7dc2956

Please sign in to comment.