Skip to content

Commit db3de2d

Browse files
committed
chore(Compass): added tests for new variants
1 parent d09b3a3 commit db3de2d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/react-core/src/components/DataList/__tests__/DataList.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ test('Renders custom class when passed', () => {
7171
expect(screen.getByLabelText('list')).toHaveClass('data-list-custom');
7272
});
7373

74+
test(`Renders with class ${styles.modifiers.plain} when isPlain is true`, () => {
75+
render(<DataList key="list-id-1" isPlain aria-label="list" />);
76+
77+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.plain);
78+
});
79+
7480
test('Renders with a hidden input to improve a11y when onSelectableRowChange is passed', () => {
7581
render(
7682
<DataList aria-label="this is a simple list" onSelectableRowChange={() => {}}>

packages/react-table/src/components/Table/__tests__/Table.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,9 @@ test('Renders expandable toggle button in Th with pf-m-small class when variant
150150
expect(button).toHaveClass('pf-m-small');
151151
});
152152
});
153+
154+
test(`Renders with class ${styles.modifiers.plain} when isPlain is true`, () => {
155+
render(<Table isPlain aria-label="Test table" />);
156+
157+
expect(screen.getByRole('grid', { name: 'Test table' })).toHaveClass(styles.modifiers.plain);
158+
});

0 commit comments

Comments
 (0)