|
1 |
| -import { render } from '@testing-library/react'; |
| 1 | +import { render, screen } from '@testing-library/react'; |
| 2 | +import styles from '@patternfly/react-styles/css/components/DualListSelector/dual-list-selector'; |
| 3 | +import { DualListSelector } from '../DualListSelector'; |
2 | 4 | import { DualListSelectorPane } from '../DualListSelectorPane';
|
3 | 5 | import { SearchInput } from '../../SearchInput';
|
| 6 | + |
| 7 | +// The following tests can be removed as part of https://github.com/patternfly/patternfly-react/issues/11838 |
| 8 | +describe('Opt-in animations', () => { |
| 9 | + test(`Does not render with class ${styles.modifiers.animateExpand} by default`, () => { |
| 10 | + render(<DualListSelector data-testid="test-id" />); |
| 11 | + |
| 12 | + expect(screen.getByTestId('test-id')).not.toHaveClass(styles.modifiers.animateExpand); |
| 13 | + }); |
| 14 | + |
| 15 | + test(`Does not render with class ${styles.modifiers.animateExpand} when hasAnimations is true and isTree is false`, () => { |
| 16 | + render(<DualListSelector hasAnimations data-testid="test-id" />); |
| 17 | + |
| 18 | + expect(screen.getByTestId('test-id')).not.toHaveClass(styles.modifiers.animateExpand); |
| 19 | + }); |
| 20 | + |
| 21 | + test(`Does not render with class ${styles.modifiers.animateExpand} by default when isTree is true`, () => { |
| 22 | + render(<DualListSelector isTree data-testid="test-id" />); |
| 23 | + |
| 24 | + expect(screen.getByTestId('test-id')).not.toHaveClass(styles.modifiers.animateExpand); |
| 25 | + }); |
| 26 | + |
| 27 | + test(`Renders with class ${styles.modifiers.animateExpand} when both isTree and hasAnimations are true`, () => { |
| 28 | + render(<DualListSelector isTree hasAnimations data-testid="test-id" />); |
| 29 | + |
| 30 | + expect(screen.getByTestId('test-id')).toHaveClass(styles.modifiers.animateExpand); |
| 31 | + }); |
| 32 | +}); |
| 33 | + |
| 34 | +// Following tests should be moved to a separate DualListSelectorPane test file |
4 | 35 | describe('DualListSelector', () => {
|
5 | 36 | test('basic', () => {
|
6 | 37 | const { asFragment } = render(<DualListSelectorPane id="basicTest" />);
|
|
0 commit comments