Skip to content

Commit

Permalink
Add shouldRenderCustomStyles Jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 18, 2023
1 parent d188bb5 commit b971297
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/combo_box/combo_box.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import React, { ReactNode } from 'react';
import { act, fireEvent } from '@testing-library/react';
import { shallow, mount } from 'enzyme';
import { render } from '../../test/rtl';
import { shouldRenderCustomStyles } from '../../test/internal';
import {
requiredProps,
findTestSubject,
Expand Down Expand Up @@ -64,6 +65,17 @@ const options: TitanOption[] = [
];

describe('EuiComboBox', () => {
shouldRenderCustomStyles(<EuiComboBox />);

shouldRenderCustomStyles(<EuiComboBox options={[{ label: 'test' }]} />, {
skip: { parentTest: true },
childProps: ['truncationProps', 'options[0]'],
renderCallback: async ({ getByTestSubject, findAllByTestSubject }) => {
fireEvent.click(getByTestSubject('comboBoxToggleListButton'));
await findAllByTestSubject('truncatedText');
},
});

test('is rendered', () => {
const { container } = render(<EuiComboBox {...requiredProps} />);

Expand Down

0 comments on commit b971297

Please sign in to comment.